autosize 1.1.18.1 → 1.1.18.4
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/autosize.gemspec +1 -1
- data/lib/autosize/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.autosize.js +27 -14
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98671965689ddc4534c46e5952269fe9c7285c00
|
4
|
+
data.tar.gz: 1d41daa95bbdf19d2fb06f1d6d827388d60a53e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0a7b9b0ec956baa3984e240834bc57a128d0afc9526b939b6e1d84139a6dce0e57c53bdd0b66b33ef969fdef692d80e2c94116935311597041a25d95c66a780
|
7
|
+
data.tar.gz: a9ce722a0356fae797065689889819091e13faacade5982da693d299def4de81ab0e3cfda7f9795cba0bf869fed4a7fa9ff41b0dbcddccdaac6b0cdd1a59aee8
|
data/README.md
CHANGED
data/autosize.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.version = Autosize::Rails::VERSION
|
7
7
|
gem.authors = ["Jack Moore", "Adrian Rangel"]
|
8
8
|
gem.email = ["adrian.rangel@gmail.com"]
|
9
|
-
gem.homepage = "
|
9
|
+
gem.homepage = "http://www.jacklmoore.com/autosize/"
|
10
10
|
gem.summary = %q{This gem allows you to use Autosize jQuery plugin}
|
11
11
|
gem.description = %q{Small jQuery plugin to allow dynamic resizing of textarea height, so that it grows as based on visitor input. To use, just call the .autosize() method on any textarea element.}
|
12
12
|
gem.license = "MIT"
|
data/lib/autosize/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
Autosize v1.18.
|
2
|
+
Autosize v1.18.4 - 2014-01-11
|
3
3
|
Automatically adjust textarea height based on user input.
|
4
|
-
(c)
|
4
|
+
(c) 2014 Jack Moore - http://www.jacklmoore.com/autosize
|
5
5
|
license: http://www.opensource.org/licenses/mit-license.php
|
6
6
|
*/
|
7
7
|
(function ($) {
|
@@ -10,7 +10,8 @@
|
|
10
10
|
className: 'autosizejs',
|
11
11
|
append: '',
|
12
12
|
callback: false,
|
13
|
-
resizeDelay: 10
|
13
|
+
resizeDelay: 10,
|
14
|
+
placeholder: true
|
14
15
|
},
|
15
16
|
|
16
17
|
// border:0 is unnecessary, but avoids a bug in Firefox on OSX
|
@@ -91,23 +92,27 @@
|
|
91
92
|
});
|
92
93
|
|
93
94
|
// The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
|
95
|
+
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported, but also unneeded in IE8 and lower.
|
94
96
|
function setWidth() {
|
95
|
-
var
|
97
|
+
var width;
|
98
|
+
var style = window.getComputedStyle ? window.getComputedStyle(ta, null) : false;
|
96
99
|
|
97
|
-
if (
|
98
|
-
|
100
|
+
if (style) {
|
101
|
+
|
99
102
|
width = ta.getBoundingClientRect().width;
|
100
103
|
|
104
|
+
if (width === 0) {
|
105
|
+
width = parseInt(style.width,10);
|
106
|
+
}
|
107
|
+
|
101
108
|
$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
|
102
109
|
width -= parseInt(style[val],10);
|
103
110
|
});
|
104
|
-
|
105
|
-
|
106
|
-
}
|
107
|
-
else {
|
108
|
-
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported and unneeded in IE8 and lower.
|
109
|
-
mirror.style.width = Math.max($ta.width(), 0) + 'px';
|
111
|
+
} else {
|
112
|
+
width = Math.max($ta.width(), 0);
|
110
113
|
}
|
114
|
+
|
115
|
+
mirror.style.width = width + 'px';
|
111
116
|
}
|
112
117
|
|
113
118
|
function initMirror() {
|
@@ -151,7 +156,15 @@
|
|
151
156
|
setWidth();
|
152
157
|
}
|
153
158
|
|
154
|
-
|
159
|
+
if (!ta.value && options.placeholder) {
|
160
|
+
// If the textarea is empty, copy the placeholder text into
|
161
|
+
// the mirror control and use that for sizing so that we
|
162
|
+
// don't end up with placeholder getting trimmed.
|
163
|
+
mirror.value = ($(ta).attr("placeholder") || '') + options.append;
|
164
|
+
} else {
|
165
|
+
mirror.value = ta.value + options.append;
|
166
|
+
}
|
167
|
+
|
155
168
|
mirror.style.overflowY = ta.style.overflowY;
|
156
169
|
original = parseInt(ta.style.height,10);
|
157
170
|
|
@@ -247,4 +260,4 @@
|
|
247
260
|
adjust();
|
248
261
|
});
|
249
262
|
};
|
250
|
-
}(window.jQuery || window.$)); // jQuery or jQuery-like library, such as Zepto
|
263
|
+
}(window.jQuery || window.$)); // jQuery or jQuery-like library, such as Zepto
|
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: 1.1.18.
|
4
|
+
version: 1.1.18.4
|
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: 2014-
|
12
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-rails
|
@@ -57,7 +57,7 @@ files:
|
|
57
57
|
- lib/autosize.rb
|
58
58
|
- lib/autosize/version.rb
|
59
59
|
- vendor/assets/javascripts/jquery.autosize.js
|
60
|
-
homepage:
|
60
|
+
homepage: http://www.jacklmoore.com/autosize/
|
61
61
|
licenses:
|
62
62
|
- MIT
|
63
63
|
metadata: {}
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project: autosize
|
80
|
-
rubygems_version: 2.2.
|
80
|
+
rubygems_version: 2.2.1
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: This gem allows you to use Autosize jQuery plugin
|