aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/source-viewer/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/source-viewer/app.js')
-rw-r--r--server/sonar-web/src/main/js/apps/source-viewer/app.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/source-viewer/app.js b/server/sonar-web/src/main/js/apps/source-viewer/app.js
index 1c6947db3ee..31b6047d152 100644
--- a/server/sonar-web/src/main/js/apps/source-viewer/app.js
+++ b/server/sonar-web/src/main/js/apps/source-viewer/app.js
@@ -1,6 +1,7 @@
define([
+ 'backbone.marionette',
'components/source-viewer/main'
-], function (SourceViewer) {
+], function (Marionette, SourceViewer) {
var App = new Marionette.Application(),
init = function (options) {
@@ -8,20 +9,20 @@ define([
var viewer = new SourceViewer();
this.mainRegion.show(viewer);
- viewer.open(options.file.uuid);
- if (typeof options.file.line === 'number') {
+ viewer.open(options.component.uuid);
+ if (window.line) {
viewer.on('loaded', function () {
viewer
- .highlightLine(options.file.line)
- .scrollToLine(options.file.line);
+ .highlightLine(window.line)
+ .scrollToLine(window.line);
});
}
};
App.on('start', function (options) {
- window.requestMessages().done(function () {
+ if (options.component) {
init.call(App, options);
- });
+ }
});
return App;