]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/statusline.js
Import 1.0rc1 supporting Firefox up to 11.*
[dactyl.git] / common / content / statusline.js
index b5dbee70d417e97426443a35d5017ac4f563a8cb..8eefc33ecd7f2878d0e2684a7dabd5181a297844 100644 (file)
@@ -4,7 +4,7 @@
 //
 // This work is licensed for reuse under an MIT license. Details are
 // given in the LICENSE.txt file included with this file.
-"use strict";
+/* use strict */
 
 /** @scope modules */
 
@@ -12,7 +12,6 @@ var StatusLine = Module("statusline", {
     init: function init() {
         this._statusLine = document.getElementById("status-bar");
         this.statusBar = document.getElementById("addon-bar") || this._statusLine;
-        this.statusBar.collapsed = true;
         this.baseGroup = this.statusBar == this._statusLine ? "StatusLine " : "";
 
         if (this.statusBar.localName == "toolbar") {
@@ -23,7 +22,7 @@ var StatusLine = Module("statusline", {
                 #addon-bar > xul|toolbarspring { visibility: collapse; }
             ]]></css>);
 
-            util.overlayWindow(window, { append: <><statusbar id="status-bar" ordinal="0"/></> });
+            overlay.overlayWindow(window, { append: <><statusbar id="status-bar" ordinal="0"/></> });
 
             highlight.loadCSS(util.compileMacro(<![CDATA[
                 !AddonBar;#addon-bar {
@@ -42,7 +41,7 @@ var StatusLine = Module("statusline", {
                     color: inherit !important;
                 }
                 AddonButton:not(:hover)  background: transparent;
-            ]]>)({ padding: util.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
+            ]]>)({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
 
             if (document.getElementById("appmenu-button"))
                 highlight.loadCSS(<![CDATA[
@@ -83,7 +82,7 @@ var StatusLine = Module("statusline", {
         for each (let attr in prepend..@key)
             attr.parent().@id = "dactyl-statusline-field-" + attr;
 
-        util.overlayWindow(window, {
+        overlay.overlayWindow(window, {
             objects: this.widgets = { get status() this.container },
             prepend: prepend.elements()
         });
@@ -141,12 +140,16 @@ var StatusLine = Module("statusline", {
                 webProgress.DOMWindow.document.dactylSecurity = this.security;
         },
         "browser.stateChange": function onStateChange(webProgress, request, flags, status) {
-            if (flags & Ci.nsIWebProgressListener.STATE_START)
-                this.progress = 0;
-            if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
-                this.progress = "";
+            const L = Ci.nsIWebProgressListener;
+
+            if (flags & (L.STATE_IS_DOCUMENT | L.STATE_IS_WINDOW))
+                if (flags & L.STATE_START)
+                    this.progress = 0;
+                else if (flags & L.STATE_STOP)
+                    this.progress = "";
+
+            if (flags & L.STATE_STOP)
                 this.updateStatus();
-            }
         },
         "browser.statusChange": function onStatusChange(webProgress, request, status, message) {
             this.timeout(function () {