autosize-rails 1.18.15 → 1.18.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autosize/rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.autosize.js +11 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87ffef5bee0d42f74a56292930a5afbe60b8048a
|
4
|
+
data.tar.gz: 31d4234fc007c3de4b77e802ccc5c2cf4a1d22f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91f4252c25d694cdcfc5b322e34f624ba1fc23789d52467de7472e2801d5dac9fb44ce25fb1a932ea7ccb609c2864de2a81c621414ecd166a279428345f2626
|
7
|
+
data.tar.gz: 36b30cfe5a3aadc226838c35c7384965f1a529fe112548d5f68f4f0511a4499426dacd3b8cd528944f72b6b25d79ad4cd1b56cf41033e7a0ae569d9b053a965d
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
Autosize 1.18.
|
2
|
+
Autosize 1.18.17
|
3
3
|
license: MIT
|
4
4
|
http://www.jacklmoore.com/autosize
|
5
5
|
*/
|
@@ -98,23 +98,18 @@
|
|
98
98
|
$ta.css('resize', 'horizontal');
|
99
99
|
}
|
100
100
|
|
101
|
-
//
|
102
|
-
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported, but also unneeded in IE8 and lower.
|
101
|
+
// getComputedStyle is preferred here because it preserves sub-pixel values, while jQuery's .width() rounds to an integer.
|
103
102
|
function setWidth() {
|
104
103
|
var width;
|
105
|
-
var style = window.getComputedStyle ? window.getComputedStyle(ta, null) :
|
104
|
+
var style = window.getComputedStyle ? window.getComputedStyle(ta, null) : null;
|
106
105
|
|
107
106
|
if (style) {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
107
|
+
width = parseFloat(style.width);
|
108
|
+
if (style.boxSizing === 'border-box' || style.webkitBoxSizing === 'border-box' || style.mozBoxSizing === 'border-box') {
|
109
|
+
$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
|
110
|
+
width -= parseFloat(style[val]);
|
111
|
+
});
|
113
112
|
}
|
114
|
-
|
115
|
-
$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
|
116
|
-
width -= parseFloat(style[val]);
|
117
|
-
});
|
118
113
|
} else {
|
119
114
|
width = $ta.width();
|
120
115
|
}
|
@@ -157,7 +152,7 @@
|
|
157
152
|
// Using mainly bare JS in this function because it is going
|
158
153
|
// to fire very often while typing, and needs to very efficient.
|
159
154
|
function adjust() {
|
160
|
-
var height,
|
155
|
+
var height, originalHeight;
|
161
156
|
|
162
157
|
if (mirrored !== ta) {
|
163
158
|
initMirror();
|
@@ -176,7 +171,7 @@
|
|
176
171
|
|
177
172
|
mirror.value += options.append || '';
|
178
173
|
mirror.style.overflowY = ta.style.overflowY;
|
179
|
-
|
174
|
+
originalHeight = parseFloat(ta.style.height) || 0;
|
180
175
|
|
181
176
|
// Setting scrollTop to zero is needed in IE8 and lower for the next step to be accurately applied
|
182
177
|
mirror.scrollTop = 0;
|
@@ -198,7 +193,7 @@
|
|
198
193
|
|
199
194
|
height += boxOffset;
|
200
195
|
|
201
|
-
if (
|
196
|
+
if (Math.abs(originalHeight - height) > 1/100) {
|
202
197
|
ta.style.height = height + 'px';
|
203
198
|
|
204
199
|
// Trigger a repaint for IE8 for when ta is nested 2 or more levels inside an inline-block
|