autosize-rails 1.18.6 → 1.18.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/autosize/rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.autosize.js +17 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8705bce18670d6e76566e32d8e705898e7ee1cdb
|
4
|
+
data.tar.gz: a3c474ce295904f4bd5135c5d375d0f9a6ec71b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f60ffdc75eee05f93bce60f26f494491976fa0d8b7fc604b4a2419e6ff743d9ecbaf10d85d57341f48bba5eceadae7ca078b93dd2169ef4fe265840af7f3dab0
|
7
|
+
data.tar.gz: b25a31b154f17f6bdbc5554e9e0944d73e330f3aac1a9a7fae0d77109e5748ee579cfb0dacae067d8caa8a8980a61c9405949e2fbb7af64c46a7611e65391ed4
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
|
2
|
+
Autosize v1.18.8 - 2014-05-20
|
3
3
|
Automatically adjust textarea height based on user input.
|
4
4
|
(c) 2014 Jack Moore - http://www.jacklmoore.com/autosize
|
5
5
|
license: http://www.opensource.org/licenses/mit-license.php
|
@@ -8,8 +8,8 @@
|
|
8
8
|
var
|
9
9
|
defaults = {
|
10
10
|
className: 'autosizejs',
|
11
|
-
|
12
|
-
append: '',
|
11
|
+
id: 'autosizejs',
|
12
|
+
append: '\n',
|
13
13
|
callback: false,
|
14
14
|
resizeDelay: 10,
|
15
15
|
placeholder: true
|
@@ -70,7 +70,8 @@
|
|
70
70
|
resize: ta.style.resize
|
71
71
|
},
|
72
72
|
timeout,
|
73
|
-
width = $ta.width()
|
73
|
+
width = $ta.width(),
|
74
|
+
taResize = $ta.css('resize');
|
74
75
|
|
75
76
|
if ($ta.data('autosize')) {
|
76
77
|
// exit if autosize has already been applied, or if the textarea is the mirror element.
|
@@ -88,10 +89,15 @@
|
|
88
89
|
$ta.css({
|
89
90
|
overflow: 'hidden',
|
90
91
|
overflowY: 'hidden',
|
91
|
-
wordWrap: 'break-word'
|
92
|
-
resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
|
92
|
+
wordWrap: 'break-word' // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
|
93
93
|
});
|
94
94
|
|
95
|
+
if (taResize === 'vertical') {
|
96
|
+
$ta.css('resize','none');
|
97
|
+
} else if (taResize === 'both') {
|
98
|
+
$ta.css('resize', 'horizontal');
|
99
|
+
}
|
100
|
+
|
95
101
|
// The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
|
96
102
|
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported, but also unneeded in IE8 and lower.
|
97
103
|
function setWidth() {
|
@@ -102,7 +108,7 @@
|
|
102
108
|
|
103
109
|
width = ta.getBoundingClientRect().width;
|
104
110
|
|
105
|
-
if (width === 0) {
|
111
|
+
if (width === 0 || typeof width !== 'number') {
|
106
112
|
width = parseInt(style.width,10);
|
107
113
|
}
|
108
114
|
|
@@ -121,7 +127,7 @@
|
|
121
127
|
|
122
128
|
mirrored = ta;
|
123
129
|
mirror.className = options.className;
|
124
|
-
|
130
|
+
mirror.id = options.id;
|
125
131
|
maxHeight = parseInt($ta.css('maxHeight'), 10);
|
126
132
|
|
127
133
|
// mirror is a duplicate textarea located off-screen that
|
@@ -132,8 +138,8 @@
|
|
132
138
|
$.each(typographyStyles, function(i,val){
|
133
139
|
styles[val] = $ta.css(val);
|
134
140
|
});
|
135
|
-
|
136
|
-
|
141
|
+
|
142
|
+
$(mirror).css(styles).attr('wrap', $ta.attr('wrap'));
|
137
143
|
|
138
144
|
setWidth();
|
139
145
|
|
@@ -163,7 +169,7 @@
|
|
163
169
|
// If the textarea is empty, copy the placeholder text into
|
164
170
|
// the mirror control and use that for sizing so that we
|
165
171
|
// don't end up with placeholder getting trimmed.
|
166
|
-
|
172
|
+
mirror.value = ($ta.attr("placeholder") || '') + options.append;
|
167
173
|
} else {
|
168
174
|
mirror.value = ta.value + options.append;
|
169
175
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autosize-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|