diff options
Diffstat (limited to 'app/assets/javascripts/dispatcher.js')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index baa20d0c34a..5f87a05067b 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -2,8 +2,7 @@ /* global UsernameValidator */ /* global ActiveTabMemoizer */ /* global ShortcutsNavigation */ -/* global Build */ -/* global Issuable */ +/* global IssuableIndex */ /* global ShortcutsIssuable */ /* global ZenMode */ /* global Milestone */ @@ -55,6 +54,7 @@ import UsersSelect from './users_select'; import RefSelectDropdown from './ref_select_dropdown'; import GfmAutoComplete from './gfm_auto_complete'; import ShortcutsBlob from './shortcuts_blob'; +import initSettingsPanels from './settings_panels'; (function() { var Dispatcher; @@ -118,19 +118,15 @@ import ShortcutsBlob from './shortcuts_blob'; shortcut_handler = new ShortcutsNavigation(); new UsersSelect(); break; - case 'projects:jobs:show': - new Build(); - break; case 'projects:merge_requests:index': case 'projects:issues:index': if (gl.FilteredSearchManager && document.querySelector('.filtered-search')) { const filteredSearchManager = new gl.FilteredSearchManager(page === 'projects:issues:index' ? 'issues' : 'merge_requests'); filteredSearchManager.setup(); } - Issuable.init(); - new gl.IssuableBulkActions({ - prefixId: page === 'projects:merge_requests:index' ? 'merge_request_' : 'issue_', - }); + const pagePrefix = page === 'projects:merge_requests:index' ? 'merge_request_' : 'issue_'; + IssuableIndex.init(pagePrefix); + shortcut_handler = new ShortcutsNavigation(); new UsersSelect(); break; @@ -160,9 +156,6 @@ import ShortcutsBlob from './shortcuts_blob'; case 'admin:projects:index': new ProjectsList(); break; - case 'dashboard:groups:index': - new GroupsList(); - break; case 'explore:groups:index': new GroupsList(); @@ -218,6 +211,16 @@ import ShortcutsBlob from './shortcuts_blob'; new gl.GLForm($('.tag-form')); new RefSelectDropdown($('.js-branch-select'), window.gl.availableRefs); break; + case 'projects:snippets:new': + case 'projects:snippets:edit': + case 'projects:snippets:create': + case 'projects:snippets:update': + case 'snippets:new': + case 'snippets:edit': + case 'snippets:create': + case 'snippets:update': + new gl.GLForm($('.snippet-form')); + break; case 'projects:releases:edit': new ZenMode(); new gl.GLForm($('.release-form')); @@ -322,25 +325,14 @@ import ShortcutsBlob from './shortcuts_blob'; shortcut_handler = new ShortcutsNavigation(); new TreeView(); new BlobViewer(); - gl.TargetBranchDropDown.bootstrap(); break; case 'projects:find_file:show': shortcut_handler = true; break; - case 'projects:blob:new': - gl.TargetBranchDropDown.bootstrap(); - break; - case 'projects:blob:create': - gl.TargetBranchDropDown.bootstrap(); - break; case 'projects:blob:show': new BlobViewer(); - gl.TargetBranchDropDown.bootstrap(); initBlob(); break; - case 'projects:blob:edit': - gl.TargetBranchDropDown.bootstrap(); - break; case 'projects:blame:show': initBlob(); break; @@ -364,9 +356,11 @@ import ShortcutsBlob from './shortcuts_blob'; new ProjectFork(); break; case 'projects:artifacts:browse': + new ShortcutsNavigation(); new BuildArtifacts(); break; case 'projects:artifacts:file': + new ShortcutsNavigation(); new BlobViewer(); break; case 'help:index': @@ -382,6 +376,8 @@ import ShortcutsBlob from './shortcuts_blob'; // Initialize Protected Tag Settings new ProtectedTagCreate(); new ProtectedTagEditList(); + // Initialize expandable settings panels + initSettingsPanels(); break; case 'projects:ci_cd:show': new gl.ProjectVariables(); |