jquery_match_height_rails 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb3c507574a291cedaaa772deef015a7189eacb
|
4
|
+
data.tar.gz: c93b422f036ec28568b57c7f89f9184723752962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db32a7e2c8c86f03e101aec18b3b150edce45d4d89d6fa1b8afef65f66e91e07e96255c397cf4fad41be45fc094ae2c0e9c061d188cf7cad5bbddcdf0e54a3af
|
7
|
+
data.tar.gz: ca4d65be6c71a103cb940cdedcdd7c23f52bfec4f237885dd8945251a13c0601590d341c310b51062b99e29847cce2ee7d9fc431a6a7738e7596f20fbbf4b980
|
@@ -1,11 +1,23 @@
|
|
1
1
|
/**
|
2
|
-
* jquery
|
2
|
+
* jquery-match-height master by @liabru
|
3
3
|
* http://brm.io/jquery-match-height/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
7
7
|
;
|
8
|
-
(function(
|
8
|
+
(function(factory) { // eslint-disable-line no-extra-semi
|
9
|
+
'use strict';
|
10
|
+
if (typeof define === 'function' && define.amd) {
|
11
|
+
// AMD
|
12
|
+
define(['jquery'], factory);
|
13
|
+
} else if (typeof module !== 'undefined' && module.exports) {
|
14
|
+
// CommonJS
|
15
|
+
module.exports = factory(require('jquery'));
|
16
|
+
} else {
|
17
|
+
// Global
|
18
|
+
factory(jQuery);
|
19
|
+
}
|
20
|
+
})(function($) {
|
9
21
|
/*
|
10
22
|
* internal
|
11
23
|
*/
|
@@ -132,11 +144,15 @@
|
|
132
144
|
* plugin global options
|
133
145
|
*/
|
134
146
|
|
147
|
+
matchHeight.version = 'master';
|
135
148
|
matchHeight._groups = [];
|
136
149
|
matchHeight._throttle = 80;
|
137
150
|
matchHeight._maintainScroll = false;
|
138
151
|
matchHeight._beforeUpdate = null;
|
139
152
|
matchHeight._afterUpdate = null;
|
153
|
+
matchHeight._rows = _rows;
|
154
|
+
matchHeight._parse = _parse;
|
155
|
+
matchHeight._parseOptions = _parseOptions;
|
140
156
|
|
141
157
|
/*
|
142
158
|
* matchHeight._apply
|
@@ -170,7 +186,12 @@
|
|
170
186
|
// must first force an arbitrary equal height so floating elements break evenly
|
171
187
|
$elements.each(function() {
|
172
188
|
var $that = $(this),
|
173
|
-
display = $that.css('display')
|
189
|
+
display = $that.css('display');
|
190
|
+
|
191
|
+
// temporarily force a usable display value
|
192
|
+
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
|
193
|
+
display = 'block';
|
194
|
+
}
|
174
195
|
|
175
196
|
// cache the original inline style
|
176
197
|
$that.data('style-cache', $that.attr('style'));
|
@@ -183,7 +204,8 @@
|
|
183
204
|
'margin-bottom': '0',
|
184
205
|
'border-top-width': '0',
|
185
206
|
'border-bottom-width': '0',
|
186
|
-
'height': '100px'
|
207
|
+
'height': '100px',
|
208
|
+
'overflow': 'hidden'
|
187
209
|
});
|
188
210
|
});
|
189
211
|
|
@@ -211,7 +233,13 @@
|
|
211
233
|
// iterate the row and find the max height
|
212
234
|
$row.each(function() {
|
213
235
|
var $that = $(this),
|
214
|
-
|
236
|
+
style = $that.attr('style'),
|
237
|
+
display = $that.css('display');
|
238
|
+
|
239
|
+
// temporarily force a usable display value
|
240
|
+
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
|
241
|
+
display = 'block';
|
242
|
+
}
|
215
243
|
|
216
244
|
// ensure we get the correct actual height (and not a previously set height value)
|
217
245
|
var css = {
|
@@ -225,8 +253,12 @@
|
|
225
253
|
targetHeight = $that.outerHeight(false);
|
226
254
|
}
|
227
255
|
|
228
|
-
// revert
|
229
|
-
|
256
|
+
// revert styles
|
257
|
+
if (style) {
|
258
|
+
$that.attr('style', style);
|
259
|
+
} else {
|
260
|
+
$that.css('display', '');
|
261
|
+
}
|
230
262
|
});
|
231
263
|
} else {
|
232
264
|
// if target set, use the height of the target element
|
@@ -250,7 +282,7 @@
|
|
250
282
|
}
|
251
283
|
|
252
284
|
// set the height (accounting for padding and border)
|
253
|
-
$that.css(opts.property, targetHeight - verticalPadding);
|
285
|
+
$that.css(opts.property, (targetHeight - verticalPadding) + 'px');
|
254
286
|
});
|
255
287
|
});
|
256
288
|
|
@@ -353,4 +385,4 @@
|
|
353
385
|
matchHeight._update(true, event);
|
354
386
|
});
|
355
387
|
|
356
|
-
})
|
388
|
+
});
|