jqr-helpers 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjcyN2QzOGY3ZmZlYjhlNzM3MGE5NDNiMmY3N2YxMjY4MjJiODAyNA==
4
+ MGQ5YmQwOTQ1NTAzN2I1YzcyZmFhYjRlNWM5MjVkOTBmN2M2NDc5Mw==
5
5
  data.tar.gz: !binary |-
6
- NWRmMGYwY2JiODYzY2VmYzYwNWFmYTRhZTg3MDczMzdhYTgwZDhjNw==
6
+ OWU4N2M2ZWM5MWIyOGM3M2JkYjQ2MzU0MDNlNjg3NDAyZWJkMDg2OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDdjMjc1MGIxYmJiN2Y0NDRmYjYxMjQwNDg5NzQ2MmI0NGNhOWYxMTMyNDc4
10
- Yzg5NDRjOGI3MmQ0MDBlNmM1YzdkM2JiZDc3MTNhZDRjOWI2OTdmZWFiZGZh
11
- OTVmZjJiZWUwODRhYWE1ODQzYzdlZTRjNThkYmI5M2RhYTM4ODQ=
9
+ YWE3MGQyZTc2ODg2Y2NhYWVjODg1NDViNjRmY2YzZGRiY2Y3MmFhY2Y5OWZl
10
+ N2ZmZDQ4OWYwODQ1MjcxZjJmNmVjYzcxNmE2NWRmOGJmOTNkNjI5MmI5MTEx
11
+ MzgwODMxNzUzNzNhNTBjOWYzNmU2Nzg3ZjMwYWM2NzU4NzViOTQ=
12
12
  data.tar.gz: !binary |-
13
- MjE1YTAyOWUyZjBiN2ZiZWRjZjYyMzExMjM0MGQ5YjZjNGNiM2ZlOTdjNjNl
14
- Zjc3ODkxNDUyNDhiY2E2Yzc0ZDZkZDgwNzVhNjc3NDQ2YTE4ZTg1MjRiZTEw
15
- ZjdkZmIyMzE1Y2FkMDVhZjA4YjNhZjA0NzFkYTdmYTIxMGQ0ZGU=
13
+ MTc4NjY4MWZiNTRjMTFhNGZlNjdjNTg3MGE0NjA4Zjc4NWE2YjAwZmI1NTI0
14
+ NGM2ZmNiMmJkNzY4ZWIxMTU4M2YzMDkzYzZiOTYyNTcyMTFhNzlhZDA5OGVi
15
+ MmQ4OTA1NTFlN2EwMjY3MGIxMjg3NDlhYmRlZGViZDM0OGQyZjU=
data/Readme.md CHANGED
@@ -192,6 +192,7 @@ You can monitor a field for changes using the ``ajax_change`` method:
192
192
 
193
193
  <%= ajax_change('/toggle_complete_url', :update => '.parent-row') do %>
194
194
  <%= check_box_tag 'toggle_complete', 1, my_model.complete? %>
195
+ <%= hidden_field_tag :additional_field, 'additional_value' %>
195
196
  <% end %>
196
197
 
197
198
  ## Panel Renderers ##
@@ -499,31 +499,40 @@
499
499
  element.removeAttr('data-' + val);
500
500
  });
501
501
  element.removeClass('ujs-ajax');
502
- $(this).find('input, select').data(dataMap).change(function() {
503
- // unchecked checkboxes would not be included. We'll replace it
504
- // with a checked one and value 0.
505
- $('body').remove('.jqr-hidden-checkbox');
506
- if ($(this).is(':checkbox:not(:checked)')) {
507
- $(this).uniqueId();
508
- element = $(this).clone();
509
- element.attr('id', '');
510
- element.data($(this).data());
511
- element.data('real-element', $(this).attr('id'));
512
- element.prop('value', '0');
513
- element.prop('checked', true);
514
- element.hide();
515
- element.addClass('jqr-hidden-checkbox').addClass('ujs-ajax');
516
- element.attr('data-remote', true);
517
- $('body').append(element);
518
- $.rails.handleRemote(element);
519
- }
520
- else {
521
- // Rails checks the attribute, not the data
522
- $(this).attr('data-remote', true).addClass('ujs-ajax');
523
- $.rails.handleRemote($(this));
524
- $(this).removeAttr('data-remote');
525
- }
526
- });
502
+ var hidden = $(this).find('[type=hidden]');
503
+ $(this).find('input, select').not('[type=hidden]').data(dataMap).
504
+ change(function() {
505
+ var params = hidden.map(function() {
506
+ return $(this).attr('name') + '=' +
507
+ encodeURIComponent($(this).val());
508
+ });
509
+ params = $.makeArray(params).join('&');
510
+ // unchecked checkboxes would not be included. We'll replace it
511
+ // with a checked one and value 0.
512
+ $('body').remove('.jqr-hidden-checkbox');
513
+ if ($(this).is(':checkbox:not(:checked)')) {
514
+ $(this).uniqueId();
515
+ element = $(this).clone();
516
+ element.attr('id', '');
517
+ element.data($(this).data());
518
+ element.data('real-element', $(this).attr('id'));
519
+ element.prop('value', '0');
520
+ element.prop('checked', true);
521
+ element.hide();
522
+ element.addClass('jqr-hidden-checkbox').addClass('ujs-ajax');
523
+ element.attr('data-remote', true);
524
+ $('body').append(element);
525
+ $(element).data('params', params);
526
+ $.rails.handleRemote(element);
527
+ }
528
+ else {
529
+ // Rails checks the attribute, not the data
530
+ $(this).attr('data-remote', true).addClass('ujs-ajax');
531
+ $(this).data('params', params);
532
+ $.rails.handleRemote($(this));
533
+ $(this).removeAttr('data-remote');
534
+ }
535
+ });
527
536
  });
528
537
  $(event.target).trigger('jqr.afterload');
529
538
  }
data/jqr-helpers.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jqr-helpers'
3
3
  s.require_paths = %w(. lib lib/jqr-helpers)
4
- s.version = '1.0.66'
5
- s.date = '2015-01-08'
4
+ s.version = '1.0.67'
5
+ s.date = '2015-03-02'
6
6
  s.summary = 'Helpers to print unobtrusive jQuery-UI tags.'
7
7
  s.description = <<-EOF
8
8
  This gem adds helper methods to create unobtrusive jQuery code. It outputs
@@ -1,5 +1,5 @@
1
- require 'helpers'
2
- require 'engine'
1
+ require 'jqr-helpers/helpers'
2
+ require 'jqr-helpers/engine'
3
3
 
4
4
  module JqrHelpers
5
5
  # @private
@@ -1,6 +1,6 @@
1
1
  module JqrHelpers
2
2
  # @private
3
3
  module Rails
4
- VERSION = '1.0.66'
4
+ VERSION = '1.0.67'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jqr-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.66
4
+ version: 1.0.67
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-08 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement