recordselect 3.8.6 → 3.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/jquery/record_select.js +22 -3
- data/lib/record_select/version.rb +1 -1
- 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: ff4978fb44cb07addd937f88deef34ba053e688b
|
4
|
+
data.tar.gz: cb0ba01564718643830e4512aa64fa7b25b4abd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20e9e55335923f68dcc525e56d2162702c4c2bbd2ff618fe1161e80f999ea63ccfda835f973e2d6309194c1d164ced896b18b66b2b25629309cc142d40459483
|
7
|
+
data.tar.gz: 009e8a789271d1cc341a2425103c3e30a90f07a73ce897ec35933c1ea85135bc1b604ac63e57714c832cba71250e3a8af0a3720b1dafef2b497d934bd295c2a7
|
@@ -151,13 +151,16 @@ RecordSelect.observe = function(form) {
|
|
151
151
|
form = jQuery(form);
|
152
152
|
var min_length = 0, rs = form.closest('.record-select-container').data('recordselect');
|
153
153
|
if (rs) min_length = rs.min_length;
|
154
|
-
|
154
|
+
var callback = function() {
|
155
155
|
if (form.closest('body').length) form.trigger("submit");
|
156
|
-
}
|
156
|
+
};
|
157
|
+
form.find('input.text-input').delayedObserver(callback, 0.35, {
|
157
158
|
condition: function() {
|
158
159
|
var item = jQuery(this);
|
159
160
|
return item.data('oldval') == item.val() || item.val().length < min_length;
|
160
161
|
}
|
162
|
+
}).on('paste', function() {
|
163
|
+
if (form.closest('body').length) form.trigger("submit");
|
161
164
|
});
|
162
165
|
}
|
163
166
|
|
@@ -250,7 +253,7 @@ RecordSelect.Abstract = Class.extend({
|
|
250
253
|
this.container.css('left', offset.left);
|
251
254
|
this.container.css('top', '');
|
252
255
|
this.container.css('bottom', '');
|
253
|
-
if ((this.fixed || this.body_static) && top + height > window_height) {
|
256
|
+
if (this.above || (this.fixed || this.body_static) && top + height > window_height) {
|
254
257
|
this.container.css('bottom', window_height - offset.top);
|
255
258
|
} else {
|
256
259
|
var below_space = window_height-(top-scroll), above_space = offset.top - scroll, position;
|
@@ -326,6 +329,12 @@ RecordSelect.Abstract = Class.extend({
|
|
326
329
|
return false;
|
327
330
|
}
|
328
331
|
});
|
332
|
+
jQuery(this.obj).each(function() {
|
333
|
+
if (jQuery(this).data('rs-above')) {
|
334
|
+
rs.above = true;
|
335
|
+
return false;
|
336
|
+
}
|
337
|
+
});
|
329
338
|
jQuery(document.body).append(e);
|
330
339
|
jQuery(document.body).mousedown(jQuery.proxy(this, "onbodyclick"));
|
331
340
|
if (!rs.fixed && e.offsetParent().css('position') == 'static') rs.body_static = true;
|
@@ -349,6 +358,13 @@ RecordSelect.Abstract = Class.extend({
|
|
349
358
|
this.container.find('.text-input').val(this.obj.val()).trigger(event);
|
350
359
|
},
|
351
360
|
|
361
|
+
onpaste: function(event) {
|
362
|
+
if (!this.is_open()) return;
|
363
|
+
setTimeout(function () {
|
364
|
+
this.container.find('.text-input').val(this.obj.val()).trigger(event);
|
365
|
+
}.bind(this), 0);
|
366
|
+
},
|
367
|
+
|
352
368
|
/**
|
353
369
|
* all the behavior to respond to a text field as a search box
|
354
370
|
*/
|
@@ -359,6 +375,9 @@ RecordSelect.Abstract = Class.extend({
|
|
359
375
|
// the autosearch event - needs to happen slightly late (keyup is later than keypress)
|
360
376
|
text_field.keyup(jQuery.proxy(this, 'onkeyup'));
|
361
377
|
|
378
|
+
// the autosearch event - needs to happen slightly late (keyup is later than keypress)
|
379
|
+
text_field.on('paste', jQuery.proxy(this, 'onpaste'));
|
380
|
+
|
362
381
|
// keyboard navigation, if available
|
363
382
|
if (this.onkeydown) {
|
364
383
|
text_field.keydown(jQuery.proxy(this, "onkeydown"));
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recordselect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|