summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/source-viewer
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-02-22 10:39:30 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-02-22 11:17:19 +0100
commitef39ea00c5822b114d728f73d92eed6635437b98 (patch)
tree14cc3591232af48f70ab6d440fc116e0bd05e739 /server/sonar-web/src/main/js/apps/source-viewer
parenta8b9c87ee38ab2458bd0293b1ee099266b7789ab (diff)
downloadsonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.tar.gz
sonarqube-ef39ea00c5822b114d728f73d92eed6635437b98.zip
improve code quality
Diffstat (limited to 'server/sonar-web/src/main/js/apps/source-viewer')
-rw-r--r--server/sonar-web/src/main/js/apps/source-viewer/app.js30
1 files changed, 15 insertions, 15 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 7f23ec9bbb5..1be6f211f36 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
@@ -20,23 +20,23 @@
import Marionette from 'backbone.marionette';
import SourceViewer from '../../components/source-viewer/main';
-var App = new Marionette.Application(),
- init = function () {
- let options = window.sonarqube;
+const App = new Marionette.Application();
+const init = function () {
+ let options = window.sonarqube;
- this.addRegions({ mainRegion: options.el });
+ this.addRegions({ mainRegion: options.el });
- var viewer = new SourceViewer();
- this.mainRegion.show(viewer);
- viewer.open(options.file.uuid);
- if (typeof options.file.line === 'number') {
- viewer.on('loaded', function () {
- viewer
- .highlightLine(options.file.line)
- .scrollToLine(options.file.line);
- });
- }
- };
+ const viewer = new SourceViewer();
+ this.mainRegion.show(viewer);
+ viewer.open(options.file.uuid);
+ if (typeof options.file.line === 'number') {
+ viewer.on('loaded', function () {
+ viewer
+ .highlightLine(options.file.line)
+ .scrollToLine(options.file.line);
+ });
+ }
+};
App.on('start', function () {
init.call(App);