X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=aa233f8830d849925f2f48f6d88a0c1481c7f36b;hb=f43516f20975d3b3fc7910d187af97d7a8c6dc6f;hp=098d4bd39568b2af9e91ae1166471f647994cc03;hpb=25c76232c6cacc643d1142b5f951a0e5fcc12b6b;p=jquery.git diff --git a/src/core.js b/src/core.js index 098d4bd..aa233f8 100644 --- a/src/core.js +++ b/src/core.js @@ -477,6 +477,31 @@ jQuery.fn = jQuery.prototype = { andSelf: function() { return this.add( this.prevObject ); }, + + data: function( key, value ){ + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value == null ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data == undefined && this.length ) + data = jQuery.data( this[0], key ); + + return data == null && parts[1] ? + this.data( parts[0] ) : + data; + } else + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ + jQuery.data( this, key, value ); + }); + }, + + removeData: function( key ){ + return this.each(function(){ + jQuery.removeData( this, key ); + }); + }, domManip: function( args, table, reverse, callback ) { var clone = this.length > 1, elems; @@ -827,9 +852,9 @@ jQuery.extend({ } // Opera sometimes will give the wrong display answer, this fixes it, see #2037 if ( jQuery.browser.opera && name == "display" ) { - var save = elem.style.display; - elem.style.display = "block"; - elem.style.display = save; + var save = elem.style.outline; + elem.style.outline = "0 solid black"; + elem.style.outline = save; } // Make sure we're using the right name for getting the float value