autosize 2.3.0.21 → 2.4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 766b15c40c6cb3506321494831a87c9cc884f52c
4
- data.tar.gz: 3b1bd2e17f5615a9ccbc848ba3848ea1f415bc93
3
+ metadata.gz: 38f9a1921748acf785cf4684a479f295b6569b86
4
+ data.tar.gz: 25d8d9e15abc13f4868667fabaeca1155cd0b32d
5
5
  SHA512:
6
- metadata.gz: 34c0bcc49a9ff9aef359f48bd998a5bfe17a29842a686e89b4a95c601af4876421597b59dcd8b7e24fa65fd32f432a5078d73c32129c910bf5ebda3e70f51cb3
7
- data.tar.gz: 2c5a3cd53342fef774ff189725f0edbc3412abbd2dc37c1e75c8d992d1696fa432564edd49658198bd5f18f5eb60f3b1eeded4ad2b1e0c26610fcad6164c4d6e
6
+ metadata.gz: 90879c9975e5484e8a112c73f6696f483ef433c493006321a6e424a13d45c4b094e7b59dbfcfbd27916f9ac50159b4b0a612cc0ee3fe55fff09a24dcbd2ce206
7
+ data.tar.gz: 8a301250c3c0bbc818c407b75b1f98cdd85ddc133c812b181c3a1979dab4aedf35752a95936076a2b8a8c8e4a26cf5d1e7220dd833d932918a0f38618a1aad03
@@ -1,5 +1,5 @@
1
1
  module Autosize
2
2
  module Rails
3
- VERSION = "2.3.0.21"
3
+ VERSION = "2.4.0.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Autosize 3.0.20
2
+ Autosize 4.0.0
3
3
  license: MIT
4
4
  http://www.jacklmoore.com/autosize
5
5
  */
@@ -126,7 +126,7 @@
126
126
  var overflows = getParentOverflows(ta);
127
127
  var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
128
128
 
129
- ta.style.height = 'auto';
129
+ ta.style.height = '';
130
130
 
131
131
  var endHeight = ta.scrollHeight + heightOffset;
132
132
 
@@ -156,22 +156,24 @@
156
156
 
157
157
  var styleHeight = Math.round(parseFloat(ta.style.height));
158
158
  var computed = window.getComputedStyle(ta, null);
159
- var actualHeight = Math.round(parseFloat(computed.height));
159
+
160
+ // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
161
+ var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
160
162
 
161
163
  // The actual height not matching the style height (set via the resize method) indicates that
162
- // the max-height has been exceeded, in which case the overflow should be set to visible.
164
+ // the max-height has been exceeded, in which case the overflow should be allowed.
163
165
  if (actualHeight !== styleHeight) {
164
- if (computed.overflowY !== 'visible') {
165
- changeOverflow('visible');
166
+ if (computed.overflowY === 'hidden') {
167
+ changeOverflow('scroll');
166
168
  resize();
167
- actualHeight = Math.round(parseFloat(window.getComputedStyle(ta, null).height));
169
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
168
170
  }
169
171
  } else {
170
172
  // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
171
173
  if (computed.overflowY !== 'hidden') {
172
174
  changeOverflow('hidden');
173
175
  resize();
174
- actualHeight = Math.round(parseFloat(window.getComputedStyle(ta, null).height));
176
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
175
177
  }
176
178
  }
177
179
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autosize
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.21
4
+ version: 2.4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-21 00:00:00.000000000 Z
12
+ date: 2017-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake