From 0cf14120d40263e2d0783f4b7ea2eab3fb89cf10 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Thu, 3 Jun 2010 17:11:13 -0700 Subject: [PATCH] =?UTF-8?q?+=20Started=20on=20iQ=20for=20tabitems.js;=20no?= =?UTF-8?q?w=20using=20iQ=20for=20TabItem.setBounds.=20We're=20not=20yet?= =?UTF-8?q?=20supporting=20the=20tabcandy=20bounce=20animation,=20so=20the?= =?UTF-8?q?=20tab=20movement=20boring=20now=E2=80=A6=20to=20be=20fixed=20s?= =?UTF-8?q?oon.=20+=20Added=20fadeIn=20and=20fadeOut=20to=20iQ=20+=20Added?= =?UTF-8?q?=20a=20simple=20test=20framework=20to=20stand=20in=20for=20moch?= =?UTF-8?q?itest,=20and=20gave=20it=20a=20couple=20of=20iQ=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/base/content/tabview/iq.js | 31 +++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/browser/base/content/tabview/iq.js b/browser/base/content/tabview/iq.js index f6bddd09ad5e..9634f696db0b 100644 --- a/browser/base/content/tabview/iq.js +++ b/browser/base/content/tabview/iq.js @@ -576,6 +576,7 @@ iQ.fn = iQ.prototype = { // ---------- // Function: animate animate: function(css, duration, callback) { + Utils.assert('does not yet support multi-objects (or null objects)', this.length == 1); try { this.addClass(duration); iQ.animationCount++; @@ -588,7 +589,7 @@ iQ.fn = iQ.prototype = { self.removeClass(duration); cleanedUp = true; if(iQ.isFunction(callback)) - callback(); + callback.apply(this); } }); @@ -597,6 +598,34 @@ iQ.fn = iQ.prototype = { Utils.log('iQ.fn.animate error', e); } + return this; + }, + + // ---------- + // Function: fadeOut + fadeOut: function() { + try { + this.animate({opacity: 0}, 'animate350', function() { + iQ(this).css({display: 'none'}); + }); + } catch(e) { + Utils.log(e); + } + + return this; + }, + + // ---------- + // Function: fadeIn + fadeIn: function() { + try { + this.css({display: ''}); + this.animate({opacity: 1}, 'animate350'); + } catch(e) { + Utils.log(e); + } + + return this; }, // ----------