summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/js/application.js5
-rw-r--r--data/js/lexer-input.js10
-rw-r--r--data/js/main.js2
3 files changed, 8 insertions, 9 deletions
diff --git a/data/js/application.js b/data/js/application.js
index 76ed5ae55..06a53854d 100644
--- a/data/js/application.js
+++ b/data/js/application.js
@@ -21,12 +21,11 @@ define(
* Gets called for every request after page load
* config contains app config attributes passed from php
*/
- onPageLoaded: function (config) {
- config = config || {};
+ onPageLoaded: function () {
Util.highlightLineFromHash();
Util.setTabwidthFromLocalStorage();
TabwidthInput.initialize();
- LexerInput.initialize(config.lexers);
+ LexerInput.initialize();
ThumbnailView.initialize();
this.configureTooltips();
this.setupToggleSelectAllEvent();
diff --git a/data/js/lexer-input.js b/data/js/lexer-input.js
index a4d3c7058..85c4a5432 100644
--- a/data/js/lexer-input.js
+++ b/data/js/lexer-input.js
@@ -11,10 +11,10 @@ define(['util', 'underscore', 'jquery-ui'], function (Util, _) {
var baseUrl = $(event.target).data('base-url');
this.switchLexer(ui.item.value, baseUrl);
},
- setupAutocomplete: function (lexers) {
+ setupAutocomplete: function () {
var lexerSource = [];
- for (var key in lexers) {
- lexerSource.push({ label: lexers[key], value: key });
+ for (var key in appConfig.lexers) {
+ lexerSource.push({ label: appConfig.lexers[key], value: key });
}
$('.lexer-form input').autocomplete({
@@ -37,8 +37,8 @@ define(['util', 'underscore', 'jquery-ui'], function (Util, _) {
}
};
var LexerInput = {
- initialize: function (lexers) {
- PrivateFunctions.setupAutocomplete(lexers);
+ initialize: function () {
+ PrivateFunctions.setupAutocomplete();
PrivateFunctions.setupEvents();
}
};
diff --git a/data/js/main.js b/data/js/main.js
index 92c016d79..5710dcb68 100644
--- a/data/js/main.js
+++ b/data/js/main.js
@@ -22,7 +22,7 @@ requirejs.config({
require(['application', 'jquery'], function (App, $) {
App.initialize();
$(document).ready(function () {
- App.onPageLoaded(window.appConfig);
+ App.onPageLoaded();
});
});
})();