diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/css.js | 22 | ||||
-rw-r--r-- | src/css/showHide.js | 27 |
2 files changed, 25 insertions, 24 deletions
diff --git a/src/css.js b/src/css.js index ccf0cc85e..3ab0d2f01 100644 --- a/src/css.js +++ b/src/css.js @@ -14,13 +14,12 @@ define( [ "./css/adjustCSS", "./css/addGetHookIf", "./css/support", - "./css/showHide", "./core/init", "./core/ready", "./selector" // contains ], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand, - isHidden, getStyles, swap, curCSS, adjustCSS, addGetHookIf, support, showHide ) { + isHidden, getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) { var @@ -401,25 +400,6 @@ jQuery.fn.extend( { jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); } } ); diff --git a/src/css/showHide.js b/src/css/showHide.js index 35e15bde8..327291eb1 100644 --- a/src/css/showHide.js +++ b/src/css/showHide.js @@ -1,6 +1,7 @@ define( [ - "../data/var/dataPriv" -], function( dataPriv ) { + "../data/var/dataPriv", + "../css/var/isHidden" +], function( dataPriv, isHidden ) { function showHide( elements, show ) { var display, elem, @@ -43,6 +44,26 @@ function showHide( elements, show ) { return elements; } -return showHide; +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); } ); |