Bug 1297758 - Fix race in inspector initialization to prevent this._splitter is undefined exception. r=bgrins
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 29 Sep 2016 10:02:29 -0700
changeset 315805 1723fbc9d9d88a5fbf1c57cdd1e226e36f04c522
parent 315804 1f0baee81813ef058a7d90e059c0b8de9f4c8919
child 315806 59db3b0781908d9e2145477ff8dc5a85729e25bf
child 316108 846e444511768c210822f1843f3b4e26ff7e852e
push id30756
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:00:40 +0000
treeherdermozilla-central@59db3b078190 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1297758
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1297758 - Fix race in inspector initialization to prevent this._splitter is undefined exception. r=bgrins MozReview-Commit-ID: HkHLnCaNiFK
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -443,18 +443,16 @@ Inspector.prototype = {
   /**
    * Build Splitter located between the main and side area of
    * the Inspector panel.
    */
   setupSplitter: function () {
     let SplitBox = this.React.createFactory(this.browserRequire(
       "devtools/client/shared/components/splitter/split-box"));
 
-    this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
-
     let splitter = SplitBox({
       className: "inspector-sidebar-splitter",
       initialWidth: INITIAL_SIDEBAR_SIZE,
       initialHeight: INITIAL_SIDEBAR_SIZE,
       minSize: MIN_SIDEBAR_SIZE,
       splitterSize: 1,
       endPanelControl: true,
       startPanel: this.InspectorTabPanel({
@@ -464,16 +462,18 @@ Inspector.prototype = {
         id: "inspector-sidebar-container"
       }),
       vert: this.useLandscapeMode(),
     });
 
     this._splitter = this.ReactDOM.render(splitter,
       this.panelDoc.getElementById("inspector-splitter-box"));
 
+    this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
+
     // Persist splitter state in preferences.
     this.sidebar.on("show", this.onSidebarShown);
     this.sidebar.on("hide", this.onSidebarHidden);
     this.sidebar.on("destroy", this.onSidebarHidden);
   },
 
   /**
    * Splitter clean up.