From ff909a029eb93384f1e5a52b4828163a779609b3 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Fri, 4 Jun 2010 15:08:24 -0700 Subject: [PATCH] + groups.js is now jQuery-free except for drag/drop/resize and the newTab routine + Added blur and focus event handlers to iQ + iQ.fn.data() now supports multi-objects + iQ.fn.fadeOut() now accepts a callback --- browser/base/content/tabview/iq.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/browser/base/content/tabview/iq.js b/browser/base/content/tabview/iq.js index b1630d1be6a0..3a804a1111e5 100644 --- a/browser/base/content/tabview/iq.js +++ b/browser/base/content/tabview/iq.js @@ -461,15 +461,21 @@ iQ.fn = iQ.prototype = { // ---------- // Function: data data: function(key, value) { - Utils.assert('does not yet support multi-objects (or null objects)', this.length == 1); - var data = this[0].iQData; - if(value === undefined) + if(value === undefined) { + Utils.assert('does not yet support multi-objects (or null objects)', this.length == 1); + var data = this[0].iQData; return (data ? data[key] : null); + } + + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { + var data = elem.iQData; + + if(!data) + data = elem.iQData = {}; + + data[key] = value; + } - if(!data) - data = this[0].iQData = {}; - - data[key] = value; return this; }, @@ -603,10 +609,13 @@ iQ.fn = iQ.prototype = { // ---------- // Function: fadeOut - fadeOut: function() { + fadeOut: function(callback) { try { + Utils.assert('does not yet support duration', iQ.isFunction(callback) || callback === undefined); this.animate({opacity: 0}, 'animate350', function() { iQ(this).css({display: 'none'}); + if(iQ.isFunction(callback)) + callback.apply(this); }); } catch(e) { Utils.log(e); @@ -958,7 +967,9 @@ iQ.extend({ 'mousemove', 'click', 'resize', - 'change' + 'change', + 'blur', + 'focus' ]; iQ.each(events, function(index, event) {