Skip to content

Commit f6e12ba

Browse files
committed
Merge pull request #73 from samthor/ie9-domattr
domattr support for IE9 and IE10
2 parents 8d5774a + c65c450 commit f6e12ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dialog-polyfill.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@
5858
dialog.returnValue = '';
5959
}
6060

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

0 commit comments

Comments
 (0)