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: 9649a3aa41e5d38f78a3a9f03fbeccc7ffc1fed1
4
- data.tar.gz: d8eb10d480d4f2c5dd62676a191a352f73b07fc6
3
+ metadata.gz: dcb3c507574a291cedaaa772deef015a7189eacb
4
+ data.tar.gz: c93b422f036ec28568b57c7f89f9184723752962
5
5
  SHA512:
6
- metadata.gz: b74e8ba00ec419b200fb408723a25994c7e3c443ab9287ff01d7bb028470948e1bb02c429225f4804b6767d4d26d36c3cae70acabab37c12dafaf0f26af9b97b
7
- data.tar.gz: c8d96bed76dcbb05770762a8a9943297b81e7b51a9ceecc6e16a1ecf71da35b78a599ef134b591098bd6f7ba44cad5fa3da89ef0bb59ae7d1e5688ed42fe6362
6
+ metadata.gz: db32a7e2c8c86f03e101aec18b3b150edce45d4d89d6fa1b8afef65f66e91e07e96255c397cf4fad41be45fc094ae2c0e9c061d188cf7cad5bbddcdf0e54a3af
7
+ data.tar.gz: ca4d65be6c71a103cb940cdedcdd7c23f52bfec4f237885dd8945251a13c0601590d341c310b51062b99e29847cce2ee7d9fc431a6a7738e7596f20fbbf4b980
@@ -1,11 +1,23 @@
1
1
  /**
2
- * jquery.matchHeight.js master
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') === 'inline-block' ? 'inline-block' : 'block';
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
- display = $that.css('display') === 'inline-block' ? 'inline-block' : 'block';
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 display block
229
- $that.css('display', '');
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
- })(jQuery);
388
+ });
@@ -1,3 +1,3 @@
1
1
  module JqueryMatchHeightRails
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery_match_height_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziyan Junaideen