Skip to content

Commit

Permalink
Merge pull request #73 from samthor/ie9-domattr
Browse files Browse the repository at this point in the history
domattr support for IE9 and IE10
  • Loading branch information
samthor committed Aug 26, 2015
2 parents 8d5774a + c65c450 commit f6e12ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dialog-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@
dialog.returnValue = '';
}

this.maybeHideModal = this.maybeHideModal.bind(this);
if ('MutationObserver' in window) {
var mo = new MutationObserver(this.maybeHideModal.bind(this));
// IE11+, most other browsers.
var mo = new MutationObserver(this.maybeHideModal);
mo.observe(dialog, { attributes: true, attributeFilter: ['open'] });
} else {
// TODO: Support for IE9-10.
dialog.addEventListener('DOMAttrModified', this.maybeHideModal);
}
// Note that the DOM is observed inside DialogManager while any dialog
// is being displayed as a modal, to catch modal removal from the DOM.
Expand Down

0 comments on commit f6e12ba

Please sign in to comment.