Bug 1491601 - Bind resize handler, so this.frame is not undefined when resizing a preferences subdialog. r+a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Sun, 07 Oct 2018 20:25:46 +1300
changeset 33051 04ee89d424ba
parent 33050 788a85e7fd34
child 33052 0390d62ad309
push id386
push userclokep@gmail.com
push dateTue, 23 Oct 2018 00:48:12 +0000
bugs1491601
Bug 1491601 - Bind resize handler, so this.frame is not undefined when resizing a preferences subdialog. r+a=jorgk
mail/components/preferences/subdialogs.js
--- a/mail/components/preferences/subdialogs.js
+++ b/mail/components/preferences/subdialogs.js
@@ -334,17 +334,17 @@ SubDialog.prototype = {
     this._overlay.dispatchEvent(new CustomEvent("dialogopen", {
       bubbles: true,
       detail: { dialog: this },
     }));
     this._overlay.style.visibility = "visible";
     this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded
 
     if (this._box.getAttribute("resizable") == "true") {
-      this._resizeObserver = new MutationObserver(this._onResize);
+      this._resizeObserver = new MutationObserver(this._onResize.bind(this));
       this._resizeObserver.observe(this._box, {attributes: true});
     }
 
     this._trapFocus();
   },
 
   _onResize(mutations) {
     let frame = this._frame;