|
79 | 79 | timestamp: Date.now(), |
80 | 80 | canceled: !1 |
81 | 81 | }, args); |
82 | | - }, exports.MutationObserver = function() { |
| 82 | + }, exports.getMutationObserver = function() { |
83 | 83 | if ("undefined" != typeof window) for (var prefixes = [ "", "WebKit", "Moz", "O", "Ms" ], i = 0; i < prefixes.length; i++) { |
84 | 84 | var name = prefixes[i] + "MutationObserver"; |
85 | 85 | if (name in window) return window[name]; |
86 | 86 | } |
87 | 87 | return !1; |
88 | | - }(); |
| 88 | + }; |
89 | 89 | }, function(module, exports, __webpack_require__) { |
90 | 90 | "use strict"; |
91 | 91 | function _interopRequireDefault(obj) { |
|
366 | 366 | }, |
367 | 367 | beforeMount: function() { |
368 | 368 | var _this = this; |
369 | | - _index2.default.event.$on("toggle", this.handleToggleEvent), window.addEventListener("resize", this.handleWindowResize), |
| 369 | + if (_index2.default.event.$on("toggle", this.handleToggleEvent), window.addEventListener("resize", this.handleWindowResize), |
370 | 370 | this.handleWindowResize(), this.scrollable && !this.isAutoHeight && console.warn('Modal "' + this.name + '" has scrollable flag set to true but height is not "auto" (' + this.height + ")"), |
371 | | - this.isAutoHeight && _util.MutationObserver && (this.mutationObserver = new _util.MutationObserver(function(mutations) { |
372 | | - _this.updateRenderedHeight(); |
373 | | - })), this.clickToClose && window.addEventListener("keyup", this.handleEscapeKeyUp); |
| 371 | + this.isAutoHeight) { |
| 372 | + var MutationObserver = (0, _util.getMutationObserver)(); |
| 373 | + MutationObserver && (this.mutationObserver = new MutationObserver(function(mutations) { |
| 374 | + _this.updateRenderedHeight(); |
| 375 | + })); |
| 376 | + } |
| 377 | + this.clickToClose && window.addEventListener("keyup", this.handleEscapeKeyUp); |
374 | 378 | }, |
375 | 379 | beforeDestroy: function() { |
376 | 380 | _index2.default.event.$off("toggle", this.handleToggleEvent), window.removeEventListener("resize", this.handleWindowResize), |
|
0 commit comments