File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 9090 * @deprecated will be replaced with a more robust implementation
9191 */
9292
93- var w ;
93+ var
94+ /**
95+ * @type {Boolean }
96+ *
97+ * Mutex to control horizontal animation
98+ * Disables clicking of tabs while animating
99+ * They mess up otherwise as currentPane gets set *after* animation is done
100+ */
101+ animating ,
102+ /**
103+ * @type {Number }
104+ *
105+ * Initial width of tab panes
106+ */
107+ w ;
94108
95109 $ . tools . tabs . addEffect ( "horizontal" , function ( i , done ) {
110+ if ( animating ) return ; // don't allow other animations
96111
97112 var nextPane = this . getPanes ( ) . eq ( i ) ,
98113 currentPane = this . getCurrentPane ( ) ;
99114
100115 // store original width of a pane into memory
101116 w || ( w = this . getPanes ( ) . eq ( 0 ) . width ( ) ) ;
117+ animating = true ;
102118
103119 nextPane . show ( ) ; // hidden by default
104120
111127 complete : function ( ) {
112128 $ ( this ) . hide ( ) ;
113129 done . call ( ) ;
130+ animating = false ;
114131 }
115132 } ) ;
116133 // Dirty hack... onLoad, currentPant will be empty and nextPane will be the first pane
117- // If this is the case, manually run callback since the animation never occured
118- if ( ! currentPane . length ) { done . call ( ) ; }
134+ // If this is the case, manually run callback since the animation never occured, and reset animating
135+ if ( ! currentPane . length ) {
136+ done . call ( ) ;
137+ animating = false ;
138+ }
119139 } ) ;
120140
121141
You can’t perform that action at this time.
0 commit comments