Skip to content

Commit

Permalink
DOMSubtreeModified deprecation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hexplor committed Sep 29, 2023
1 parent 2796588 commit 7519e3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 10 additions & 4 deletions assets/common/application/offcanvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ var Offcanvas = new prime({
},

attachMutationEvent: function() {
this.offcanvas.on('DOMSubtreeModified', this.bound('_checkTogglers')); // IE8 < has propertychange
if (this.offcanvas instanceof Node) {
var observer = new MutationObserver(this.bound('_checkTogglers'));
observer.observe(this.offcanvas, { childList: true, subtree: true });
}
},

attachTouchEvents: function() {
var msPointerSupported = window.navigator.msPointerEnabled,
touch = {
Expand Down Expand Up @@ -164,9 +167,12 @@ var Offcanvas = new prime({
},

detachMutationEvent: function() {
this.offcanvas.off('DOMSubtreeModified', this.bound('_checkTogglers'));
if (this.offcanvas instanceof Node) {
var observer = new MutationObserver(this.bound('_checkTogglers'));
observer.disconnect();
}
},

detachTouchEvents: function() {
var msPointerSupported = window.navigator.msPointerEnabled,
touch = {
Expand Down
2 changes: 1 addition & 1 deletion assets/common/js/main.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ var minifyJS = function() {
return merge(streams);
};

function minify() {
if (!prod) { return; }
function minify(done) {
if (!prod) {
done();
return;
}

return minifyJS();
}
Expand Down

0 comments on commit 7519e3d

Please sign in to comment.