Bug 1377845 - Fix TypeError: frame is undefined when resizing sub-dialog window r?scottwu,MattN
MozReview-Commit-ID: HjiaIyZHgkL
--- a/browser/components/preferences/in-content-new/subdialogs.js
+++ b/browser/components/preferences/in-content-new/subdialogs.js
@@ -323,16 +323,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._onResize = this._onResize.bind(this);
this._resizeObserver = new MutationObserver(this._onResize);
this._resizeObserver.observe(this._box, {attributes: true});
}
this._trapFocus();
// Search within main document and highlight matched keyword.
gSearchResultsPane.searchWithinNode(this._titleElement, gSearchResultsPane.query);
--- a/browser/components/preferences/in-content/subdialogs.js
+++ b/browser/components/preferences/in-content/subdialogs.js
@@ -323,16 +323,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._onResize = this._onResize.bind(this);
this._resizeObserver = new MutationObserver(this._onResize);
this._resizeObserver.observe(this._box, {attributes: true});
}
this._trapFocus();
},
_onResize(mutations) {