MDL-63094 js: Do not check visibility before hiding backdrop
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 8 Aug 2018 01:58:44 +0000 (09:58 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 22 Aug 2018 02:23:30 +0000 (10:23 +0800)
It's possible for the backdrop to be created during the show, before the
modal is actually fully shown.

This check is unnecessary because the getBackdrop() function always
returns a value and will always succeed.

lib/amd/build/modal.min.js
lib/amd/src/modal.js

index b60885a..661071e 100644 (file)
Binary files a/lib/amd/build/modal.min.js and b/lib/amd/build/modal.min.js differ
index 91466e3..be98211 100644 (file)
@@ -577,10 +577,6 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
      * @method hide
      */
     Modal.prototype.hide = function() {
-        if (!this.isVisible()) {
-            return;
-        }
-
         this.getBackdrop().done(function(backdrop) {
             if (!this.countOtherVisibleModals()) {
                 // Hide the backdrop if we're the last open modal.