[Pkg-mozext-commits] [firebug] 12/59: Make sure the options can be added after FBTrace is opened (related to firebug.next at issue#1)

David Prévot taffit at moszumanska.debian.org
Thu Aug 14 14:52:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 235efff40332f85cb34b55f2da0de6bf98d083e4
Author: Florent FAYOLLE <florent.fayolle69 at gmail.com>
Date:   Sun Jul 13 09:54:24 2014 +0200

    Make sure the options can be added after FBTrace is opened (related to
    firebug.next at issue#1)
    
    Conflicts:
    	trace/FBTrace/chrome/content/traceFirebugOverlay.js
---
 trace/FBTrace/chrome/content/commonBaseUI.js | 60 ++++++++++++++++++----------
 1 file changed, 40 insertions(+), 20 deletions(-)

diff --git a/trace/FBTrace/chrome/content/commonBaseUI.js b/trace/FBTrace/chrome/content/commonBaseUI.js
index 023c438..be05e04 100644
--- a/trace/FBTrace/chrome/content/commonBaseUI.js
+++ b/trace/FBTrace/chrome/content/commonBaseUI.js
@@ -22,6 +22,11 @@ var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 // ********************************************************************************************* //
+// Variables
+
+var timerUpdateButtons = -1;
+
+// ********************************************************************************************* //
 // CommonBaseUI
 
 var CommonBaseUI = {
@@ -41,7 +46,6 @@ var CommonBaseUI = {
 
         // This IFRAME is the container for all logs.
         var logTabIframe = parentNode.getElementsByClassName("traceInfoLogsFrame").item(0);
-        var self = this;
 
         logTabIframe.addEventListener("load", function(event)
         {
@@ -78,11 +82,44 @@ var CommonBaseUI = {
             var button = parentNode.ownerDocument.getElementById(optionName);
             if (button)
                 button.setAttribute("checked", optionValue?"true":"false");
-            else
+            else if (timerUpdateButtons === -1)
+            {
                 FBTrace.sysout("traceModule onPrefChange no button with name "+optionName+
-                    " in parentNode", parentNode);
+                    " in parentNode; regenerate options panel", parentNode);
+
+                timerUpdateButtons = setTimeout(() => {
+                    timerUpdateButtons = -1;
+                    CommonBaseUI.generateOptionsButton(optionsBody);
+                });
+            }
         });
 
+        this.generateOptionsButton(optionsBody);
+
+        try
+        {
+            // Initialize global options
+            var globalBody = parentNode.querySelector(".traceInfoGlobalText");
+            if (globalBody)
+                GlobalTab.render(globalBody);
+        }
+        catch (e)
+        {
+            window.dump("FBTrace; globalOptions EXCEPTION " + e + "\n");
+        }
+
+        // Select default tab.
+        rep.selectTabByName(parentNode, "Logs");
+
+        this.optionsController.addObserver();
+    },
+
+    generateOptionsButton: function(optionsBody)
+    {
+        // Empty optionsBody if we regenerate the Options.
+        optionsBody.innerHTML = "";
+
+        var doc = optionsBody.ownerDocument;
         var menuitems = this.optionsController.getOptionsMenuItems();
         for (var i=0; i<menuitems.length; i++)
         {
@@ -101,23 +138,6 @@ var CommonBaseUI = {
 
             optionsBody.appendChild(button);
         }
-
-        try
-        {
-            // Initialize global options
-            var globalBody = parentNode.querySelector(".traceInfoGlobalText");
-            if (globalBody)
-                GlobalTab.render(globalBody);
-        }
-        catch (e)
-        {
-            window.dump("FBTrace; globalOptions EXCEPTION " + e + "\n");
-        }
-
-        // Select default tab.
-        rep.selectTabByName(parentNode, "Logs");
-
-        this.optionsController.addObserver();
     },
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list