@@ -11,16 +11,15 @@ define([
1111 "./css/var/swap" ,
1212 "./css/curCSS" ,
1313 "./css/adjustCSS" ,
14- "./css/defaultDisplay" ,
1514 "./css/addGetHookIf" ,
1615 "./css/support" ,
17- "./data/var/dataPriv " ,
16+ "./css/showHide " ,
1817
1918 "./core/init" ,
2019 "./core/ready" ,
2120 "./selector" // contains
2221] , function ( jQuery , pnum , access , rmargin , rcssNum , rnumnonpx , cssExpand , isHidden ,
23- getStyles , swap , curCSS , adjustCSS , defaultDisplay , addGetHookIf , support , dataPriv ) {
22+ getStyles , swap , curCSS , adjustCSS , addGetHookIf , support , showHide ) {
2423
2524var
2625 // Swappable if display is none or starts with table
@@ -151,65 +150,6 @@ function getWidthOrHeight( elem, name, extra ) {
151150 ) + "px" ;
152151}
153152
154- function showHide ( elements , show ) {
155- var display , elem , hidden ,
156- values = [ ] ,
157- index = 0 ,
158- length = elements . length ;
159-
160- for ( ; index < length ; index ++ ) {
161- elem = elements [ index ] ;
162- if ( ! elem . style ) {
163- continue ;
164- }
165-
166- values [ index ] = dataPriv . get ( elem , "olddisplay" ) ;
167- display = elem . style . display ;
168- if ( show ) {
169- // Reset the inline display of this element to learn if it is
170- // being hidden by cascaded rules or not
171- if ( ! values [ index ] && display === "none" ) {
172- elem . style . display = "" ;
173- }
174-
175- // Set elements which have been overridden with display: none
176- // in a stylesheet to whatever the default browser style is
177- // for such an element
178- if ( elem . style . display === "" && isHidden ( elem ) ) {
179- values [ index ] = dataPriv . access (
180- elem ,
181- "olddisplay" ,
182- defaultDisplay ( elem . nodeName )
183- ) ;
184- }
185- } else {
186- hidden = isHidden ( elem ) ;
187-
188- if ( display !== "none" || ! hidden ) {
189- dataPriv . set (
190- elem ,
191- "olddisplay" ,
192- hidden ? display : jQuery . css ( elem , "display" )
193- ) ;
194- }
195- }
196- }
197-
198- // Set the display of most of the elements in a second loop
199- // to avoid the constant reflow
200- for ( index = 0 ; index < length ; index ++ ) {
201- elem = elements [ index ] ;
202- if ( ! elem . style ) {
203- continue ;
204- }
205- if ( ! show || elem . style . display === "none" || elem . style . display === "" ) {
206- elem . style . display = show ? values [ index ] || "" : "none" ;
207- }
208- }
209-
210- return elements ;
211- }
212-
213153jQuery . extend ( {
214154
215155 // Add in style property hooks for overriding the default
0 commit comments