diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-02 15:32:53 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-10 12:14:22 +0300 |
commit | fa2af5e0f5e290eff32f62c7ea9f935a6ad33967 (patch) | |
tree | 539846b44a1e8e5c0c3117bf71455c6131c135d1 /app/assets/javascripts/main.js | |
parent | 99806914a5ca382b22588de722a0db1c7a8bfff6 (diff) |
Flash is now a ES6 module
Reduced the technical debt around our JS flash function by making it a
module that is imported rather than relying on the global function.
The global function still exists mainly for technical debt with how
some requests are being completed, but new JS should import the module
directly.
Also reduces some tech debt in the file by removing the need for jQuery.
Instead Flash is now 100% vanilla JS.
Diffstat (limited to 'app/assets/javascripts/main.js')
-rw-r--r-- | app/assets/javascripts/main.js | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 974121412bd..bbe9553869b 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -1,5 +1,4 @@ /* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */ -/* global Flash */ /* global ConfirmDangerModal */ /* global Aside */ @@ -75,7 +74,7 @@ import './diff'; import './dropzone_input'; import './due_date_select'; import './files_comment_button'; -import './flash'; +import Flash from './flash'; import './gl_dropdown'; import './gl_field_error'; import './gl_field_errors'; @@ -168,7 +167,6 @@ $(function () { var $document = $(document); var $window = $(window); var $sidebarGutterToggle = $('.js-sidebar-toggle'); - var $flash = $('.flash-container'); var bootstrapBreakpoint = bp.getBreakpointSize(); var fitSidebarForSize; @@ -253,13 +251,6 @@ $(function () { // Form submitter }); gl.utils.localTimeAgo($('abbr.timeago, .js-timeago'), true); - // Flash - if ($flash.length > 0) { - $flash.click(function () { - return $(this).fadeOut(); - }); - $flash.show(); - } // Disable form buttons while a form is submitting $body.on('ajax:complete, ajax:beforeSend, submit', 'form', function (e) { var buttons; |