recordselect 3.9.2 → 3.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/jquery/record_select.js +10 -5
- data/app/views/record_select/_list.html.erb +2 -2
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/lib/record_select/extensions/localization.rb +2 -2
- data/lib/record_select/version.rb +2 -2
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 58e05023b54997c064a2d7a8bb02ef6151acfaaffd9a08f4d10ffdb8cd0dccf1
|
4
|
+
data.tar.gz: 506a4c828e5cdbdb55a804956f45b6cfed42c0b39cb1acac19d03f0de1c1080f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e4a27654b8073a8bbd056114516b602e5b5360522fc8840491e1dbd74fb1c4296810b736757b1f1c57247565a48146e249a3532e95041fdfe4defa5fff5cdf3
|
7
|
+
data.tar.gz: ef50ef893fbdce231b0ca8d0299c42e0a15c37d8f4fdc257c467a223fb12cdeb69c006807489117b41c48dc5a7d7ebfb47a189f41b72d922c5ccb48ac7a40ba8
|
@@ -80,7 +80,7 @@ if (typeof(jQuery.fn.delayedObserver) === 'undefined') {
|
|
80
80
|
var el = $(this);
|
81
81
|
var op = options || {};
|
82
82
|
el.data('oldval', el.val())
|
83
|
-
.data('delay', delay || 0.5)
|
83
|
+
.data('delay', delay === 0 ? delay : (delay || 0.5))
|
84
84
|
.data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); })
|
85
85
|
.data('callback', callback)
|
86
86
|
[(op.event||'keyup')](function(){
|
@@ -117,8 +117,11 @@ jQuery(document).ready(function() {
|
|
117
117
|
return false;
|
118
118
|
});
|
119
119
|
jQuery(document).on('ajax:beforeSend', '.record-select-container', function(event, xhr) {
|
120
|
-
var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr;
|
120
|
+
var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr, found = jQuery(this).find('.found');
|
121
|
+
jQuery(this).find('.record, .pagination').remove();
|
122
|
+
found.html(found.data('searching'));
|
121
123
|
rs.current_xhr = xhr;
|
124
|
+
console.log(rs.current_xhr);
|
122
125
|
if (cur) cur.abort();
|
123
126
|
});
|
124
127
|
jQuery(document).on('ajax:complete', '.record-select-container', function(event, xhr, status) {
|
@@ -154,7 +157,9 @@ RecordSelect.observe = function(form) {
|
|
154
157
|
var callback = function() {
|
155
158
|
if (form.closest('body').length) form.trigger("submit");
|
156
159
|
};
|
157
|
-
|
160
|
+
var delay = parseFloat(rs.obj.data('rsDelay'));
|
161
|
+
if (isNaN(delay)) delay = 0.35;
|
162
|
+
form.find('input.text-input').delayedObserver(callback, delay, {
|
158
163
|
condition: function() {
|
159
164
|
var item = jQuery(this);
|
160
165
|
return item.data('oldval') == item.val() || item.val().length < min_length;
|
@@ -534,7 +539,7 @@ RecordSelect.Autocomplete = RecordSelect.Abstract.extend({
|
|
534
539
|
if (this.options.label) this.set(this.options.label);
|
535
540
|
|
536
541
|
this._respond_to_text_field(this.obj);
|
537
|
-
if (this.obj.focused) this.open(); // if it was focused before we could attach observers
|
542
|
+
if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers
|
538
543
|
},
|
539
544
|
|
540
545
|
close: function() {
|
@@ -587,7 +592,7 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
587
592
|
}
|
588
593
|
|
589
594
|
this._respond_to_text_field(this.obj);
|
590
|
-
if (this.obj.focused) this.open(); // if it was focused before we could attach observers
|
595
|
+
if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers
|
591
596
|
},
|
592
597
|
|
593
598
|
onselect: function(id, value, text, item) {
|
@@ -7,8 +7,8 @@ prev_url = url_for(pagination_url_params.merge(:page => page.prev.number)) if pa
|
|
7
7
|
next_url = url_for(pagination_url_params.merge(:page => page.next.number)) if page.next?
|
8
8
|
-%>
|
9
9
|
<%= content_tag :ol, :class => ('scrollable' unless record_select_config.pagination?) do %>
|
10
|
-
|
11
|
-
:model => record_select_config.model.model_name.human(:count => page.pager.count).downcase)
|
10
|
+
<%= content_tag :li, rs_(:records_found, :count => page.pager.count,
|
11
|
+
:model => record_select_config.model.model_name.human(:count => page.pager.count).downcase), class: 'found', data: {searching: rs_(:searching)} %>
|
12
12
|
<% if page.prev? -%>
|
13
13
|
<li class="pagination previous">
|
14
14
|
<%= link_to image_tag('record_select/previous.gif', :alt => rs_(:previous)) + " " + rs_(:previous_items,
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
class Object
|
5
5
|
def rs_(key, options = {})
|
6
6
|
unless key.blank?
|
7
|
-
text = I18n.translate "#{key}", {:scope => [:record_select], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
|
7
|
+
text = I18n.translate "#{key}", **{:scope => [:record_select], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
|
8
8
|
# text = nil if text.include?('translation missing:')
|
9
9
|
end
|
10
|
-
text ||= key
|
10
|
+
text ||= key
|
11
11
|
text
|
12
12
|
end
|
13
13
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recordselect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
8
8
|
- Volker Hochstein
|
9
9
|
- Lance Ivy
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -84,7 +84,7 @@ homepage: http://github.com/scambra/recordselect
|
|
84
84
|
licenses:
|
85
85
|
- MIT
|
86
86
|
metadata: {}
|
87
|
-
post_install_message:
|
87
|
+
post_install_message:
|
88
88
|
rdoc_options: []
|
89
89
|
require_paths:
|
90
90
|
- lib
|
@@ -99,9 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
|
103
|
-
|
104
|
-
signing_key:
|
102
|
+
rubygems_version: 3.3.7
|
103
|
+
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: RecordSelect widget as a replacement for massive drop down lists
|
107
106
|
test_files:
|