recordselect 3.9.2 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39316811206d9b93b95f08928b3f2fa84f1f8aea
4
- data.tar.gz: 3ba41c4b7d82e76e945e0cdc6b191fa0e026bc02
3
+ metadata.gz: 939fd5b49a9910e69dbfd85b888ab1838bc3167e
4
+ data.tar.gz: edc1b94925eb6edfd0e75cccd978d0b9029168b1
5
5
  SHA512:
6
- metadata.gz: 5cdd77053e962683595c9a6fc469952295431884eda80b4e9893d1b546bc9f79e7b33cff65f33fcfeab360efcbf49a7b466136cd6fb0ae4a7100d3e90de7f919
7
- data.tar.gz: bf10fb693fa2a85e2bdf0aef2904a48d1837143f039103765a77884a12d096f8584a56bbc55da8bf7d5feced97725ec34a6daf86dca2a45e66211245ff5eed97
6
+ metadata.gz: 0760dff3cec73a2067192f889af7cba14b29a226d6432eda90ffe691cb65e558f22627e5638f0217e93c4ae743ecf4b00089dc15cb37ba7bbcc2353144628470
7
+ data.tar.gz: f99d7d2cfdefb26d0de1c81ff3da3c89cf0e4d01fcbb9222a94a2a4d05af6d1e88aaa9db124cc4b70410c27cdbcd6c4ded5c9e17f138b687e09271ed29b1e30c
@@ -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
- form.find('input.text-input').delayedObserver(callback, 0.35, {
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;
@@ -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
- <li class="found"><%= rs_(:records_found, :count => page.pager.count,
11
- :model => record_select_config.model.model_name.human(:count => page.pager.count).downcase) %></li>
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,
@@ -1,5 +1,6 @@
1
1
  en:
2
2
  record_select:
3
+ searching: "Buscando"
3
4
  next: "Next"
4
5
  next_items: "Next %{count}"
5
6
  previous: "Previous"
@@ -1,5 +1,6 @@
1
1
  es:
2
2
  record_select:
3
+ searching: "Buscando"
3
4
  next: "Siguiente"
4
5
  next_items:
5
6
  one: "Siguente"
@@ -1,8 +1,8 @@
1
1
  module RecordSelect
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 9
5
- PATCH = 2
4
+ MINOR = 10
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.9.2
4
+ version: 3.10.0
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: 2018-02-20 00:00:00.000000000 Z
13
+ date: 2018-03-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler