13
13
_updateTimeout = - 1 ;
14
14
15
15
/*
16
- * _rows
17
- * utility function returns array of jQuery selections representing each row
16
+ * _rows
17
+ * utility function returns array of jQuery selections representing each row
18
18
* (as displayed after float wrapping applied by browser)
19
19
*/
20
20
131
131
var $that = $ ( this ) ,
132
132
display = $that . css ( 'display' ) === 'inline-block' ? 'inline-block' : 'block' ;
133
133
134
- $that . css ( {
134
+ $that . data ( 'original_style' , $that . attr ( 'style' ) ) . css ( {
135
135
'display' : display ,
136
136
'padding-top' : '0' ,
137
137
'padding-bottom' : '0' ,
144
144
// get the array of rows (based on element top position)
145
145
rows = _rows ( $elements ) ;
146
146
147
- // revert the temporary forced style
148
- $elements . css ( {
149
- 'display' : '' ,
150
- 'padding-top' : '' ,
151
- 'padding-bottom' : '' ,
152
- 'border-top-width' : '' ,
153
- 'border-bottom-width' : '' ,
154
- 'height' : ''
147
+ $elements . each ( function ( ) {
148
+ var $that = $ ( this ) ;
149
+
150
+ $that . attr ( 'style' , $that . data ( 'original_style' ) ) ;
155
151
} ) ;
156
152
}
157
153
213
209
* $.fn.matchHeight._applyDataApi
214
210
* applies matchHeight to all elements with a data-match-height attribute
215
211
*/
216
-
212
+
217
213
$ . fn . matchHeight . _applyDataApi = function ( ) {
218
214
var groups = { } ;
219
215
234
230
} ) ;
235
231
} ;
236
232
237
- /*
233
+ /*
238
234
* $.fn.matchHeight._update
239
235
* updates matchHeight on all current groups with their correct options
240
236
*/
246
242
} ;
247
243
248
244
$ . fn . matchHeight . _update = function ( throttle , event ) {
249
- // prevent update if fired from a resize event
245
+ // prevent update if fired from a resize event
250
246
// where the viewport width hasn't actually changed
251
247
// fixes an event looping bug in IE8
252
248
if ( event && event . type === 'resize' ) {
267
263
}
268
264
} ;
269
265
270
- /*
266
+ /*
271
267
* bind events
272
268
*/
273
269
274
270
// apply on DOM ready event
275
271
$ ( $ . fn . matchHeight . _applyDataApi ) ;
276
272
277
273
// update heights on load and resize events
278
- $ ( window ) . bind ( 'load' , function ( event ) {
274
+ $ ( window ) . bind ( 'load' , function ( event ) {
279
275
$ . fn . matchHeight . _update ( ) ;
280
276
} ) ;
281
277
282
278
// throttled update heights on resize events
283
- $ ( window ) . bind ( 'resize orientationchange' , function ( event ) {
279
+ $ ( window ) . bind ( 'resize orientationchange' , function ( event ) {
284
280
$ . fn . matchHeight . _update ( true , event ) ;
285
281
} ) ;
286
282
287
- } ) ( jQuery ) ;
283
+ } ) ( jQuery ) ;
0 commit comments