summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-15 14:38:36 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-15 14:38:36 +0100
commita94fe0348127ab5993fa6fea344f99272f73be20 (patch)
treea2333fa8caeff43db45d6defe3bb3973c150df94
parente2ffb8698751769879e21626c79f9c607a630bf5 (diff)
downloadgitlab-ce-prep-ce-for-ee-dispatcher.tar.gz
Preped CE dispatcher for changes for EE dispatcher in gitlab-eenpm configprep-ce-for-ee-dispatcher
-rw-r--r--app/assets/javascripts/dispatcher.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 1a791395d6f..66d558ee262 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -59,22 +59,23 @@ const ShortcutsBlob = require('./shortcuts_blob');
var Dispatcher;
$(function() {
- return new Dispatcher();
+ const page = $('body').attr('data-page');
+
+ if (!page) return;
+
+ new Dispatcher(page);
});
Dispatcher = (function() {
- function Dispatcher() {
+ function Dispatcher(page) {
this.initSearch();
this.initFieldErrors();
- this.initPageScripts();
+ this.initPageScripts(page);
}
- Dispatcher.prototype.initPageScripts = function() {
- var page, path, shortcut_handler, fileBlobPermalinkUrlElement, fileBlobPermalinkUrl;
- page = $('body').attr('data-page');
- if (!page) {
- return false;
- }
+ Dispatcher.prototype.initPageScripts = function(page) {
+ var path, shortcut_handler, fileBlobPermalinkUrlElement, fileBlobPermalinkUrl;
+
path = page.split(':');
shortcut_handler = null;