diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-12-22 14:24:15 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-12-22 14:24:15 +0300 |
commit | 079e0796aef76a384d99df3d9a398e9890af6991 (patch) | |
tree | 1a42f4900297df8b11400fc1de735f77ac3ab159 /src | |
parent | 82d10848c66e33a221e1231f400c8a3ab5edb798 (diff) | |
download | jquery-079e0796aef76a384d99df3d9a398e9890af6991.tar.gz jquery-079e0796aef76a384d99df3d9a398e9890af6991.zip |
Revert "CSS: Make show/hide/toggle methods a module"
This reverts commit 3842246024475eafdc8a00a7ac4358d06d76cab2.
Diffstat (limited to 'src')
-rw-r--r-- | src/css.js | 22 | ||||
-rw-r--r-- | src/css/showHide.js | 28 |
2 files changed, 23 insertions, 27 deletions
diff --git a/src/css.js b/src/css.js index cfd0cc88a..30d6b75d1 100644 --- a/src/css.js +++ b/src/css.js @@ -13,12 +13,13 @@ 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, swap, curCSS, adjustCSS, addGetHookIf, support ) { + isHidden, swap, curCSS, adjustCSS, addGetHookIf, support, showHide ) { var @@ -505,6 +506,25 @@ 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 47d353a67..ebaef5fb4 100644 --- a/src/css/showHide.js +++ b/src/css/showHide.js @@ -1,8 +1,4 @@ -define( [ - "../core", - "../css/var/isHidden" -], function( jQuery, isHidden ) { - +define( [], function() { function showHide( elements, show ) { var display, elem, values = [], @@ -44,26 +40,6 @@ function showHide( elements, show ) { return elements; } -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(); - } - } ); - } -} ); +return showHide; } ); |