This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 169169 this . target . classList . toggle ( 'polymer-collapse-closed' , add ) ;
170170 } ,
171171 updateSize : function ( size , duration , forceEnd ) {
172+ if ( duration ) {
173+ this . calcSize ( ) ;
174+ }
172175 this . setTransitionDuration ( duration ) ;
173176 var s = this . target . style ;
174177 var nochange = s [ this . dimension ] === size ;
188191 calcSize : function ( ) {
189192 return this . target . getBoundingClientRect ( ) [ this . dimension ] + 'px' ;
190193 } ,
194+ getComputedSize : function ( ) {
195+ return getComputedStyle ( this . target ) [ this . dimension ] ;
196+ } ,
191197 show : function ( ) {
192198 this . toggleClosedClass ( false ) ;
193199 // for initial update, skip the expanding animation to optimize
204210 }
205211 this . async ( function ( ) {
206212 this . updateSize ( this . size || s , this . duration , true ) ;
207- } , null , 1 ) ;
213+ } ) ;
208214 } ,
209215 hide : function ( ) {
210216 this . afterInitialUpdate = true ;
214220 }
215221 if ( this . fixedSize ) {
216222 // save the size before hiding it
217- this . size = getComputedStyle ( this . target ) [ this . dimension ] ;
223+ this . size = this . getComputedSize ( ) ;
218224 } else {
219225 this . updateSize ( this . calcSize ( ) , null ) ;
220226 }
221227 this . async ( function ( ) {
222228 this . updateSize ( 0 , this . duration ) ;
223- } , null , 1 ) ;
229+ } ) ;
224230 }
225231 } ) ;
226232 </ script >
You can’t perform that action at this time.
0 commit comments