From 97a61c6441c8a10d171cc4a99f292ec7484d6ce3 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Fri, 28 May 2010 13:54:29 -0700 Subject: [PATCH] + changed more uses of Utils.activeWindow to Utils.getCurrentWindow() + Generalized Aza's iQ.css('-moz-transform') fix --- browser/base/content/tabcandy/app/ui.js | 6 +++--- browser/base/content/tabcandy/core/iq.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/browser/base/content/tabcandy/app/ui.js b/browser/base/content/tabcandy/app/ui.js index 0ee39a8382b0..628cd9807d46 100644 --- a/browser/base/content/tabcandy/app/ui.js +++ b/browser/base/content/tabcandy/app/ui.js @@ -137,7 +137,7 @@ var Tabbar = { var self = this; visibleTabs.forEach(function(tab){ tab.collapsed = false; - Utils.activeWindow.gBrowser.moveTabTo(tab, self.el.children.length-1); + Utils.getCurrentWindow().gBrowser.moveTabTo(tab, self.el.children.length-1); }); }, @@ -177,7 +177,7 @@ window.Page = { window.statusbar.visible = false; // Mac Only - Utils.activeWindow.document.getElementById("main-window").setAttribute("activetitlebarcolor", "#C4C4C4"); + Utils.getCurrentWindow().document.getElementById("main-window").setAttribute("activetitlebarcolor", "#C4C4C4"); }, showChrome: function(){ @@ -186,7 +186,7 @@ window.Page = { window.statusbar.visible = true; // Mac Only - Utils.activeWindow.document.getElementById("main-window").removeAttribute("activetitlebarcolor"); + Utils.getCurrentWindow().document.getElementById("main-window").removeAttribute("activetitlebarcolor"); }, setupKeyHandlers: function(){ diff --git a/browser/base/content/tabcandy/core/iq.js b/browser/base/content/tabcandy/core/iq.js index 9f5c3c56d81c..c635a8461ac0 100644 --- a/browser/base/content/tabcandy/core/iq.js +++ b/browser/base/content/tabcandy/core/iq.js @@ -517,6 +517,11 @@ iQ.fn = iQ.prototype = { } else properties = a; + var subsitutions = { + '-moz-transform': 'MozTransform', + 'z-index': 'zIndex' + }; + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { iQ.each(properties, function(key, value) { if(key == 'left' || key == 'top' || key == 'width' || key == 'height') { @@ -524,12 +529,7 @@ iQ.fn = iQ.prototype = { value += 'px'; } - // -moz-transform is a special case. To set it doing elem.style["-moz-transform"] - // doesn't work. You have to use elem.style["MozTransform"]. There are probably - // other key values like this. - // TODO: Generalize. - if( key == "-moz-transform" ) key = "MozTransform"; - elem.style[key] = value; + elem.style[subsitutions[key] || key] = value; }); } },