jqr-helpers 1.0.60 → 1.0.61

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGUxYzY1YmUzM2M0ZjM0NGU1NzlhZTUwNTYwZjM0NGFhOThmNWZmZA==
4
+ OWM4N2E5ODBjYWFmYWRlMTA4MTFhYWFiZDdlZThmNTljMjQzNjI3YQ==
5
5
  data.tar.gz: !binary |-
6
- OWUzOTM5MmRiY2MwYzdjZWFjNmU4YTM4NmZlNjRlYzZlMTE3OTE5Mg==
6
+ MzkxMDc2NTA1ZTM5NWUwYzhlMDYzZGI4N2NjMDQ5YjA3ZjgyYzBhZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjIxZjFhOGNhMjE0ZGQ4ZDJlM2EzMGJlZDIxODI5ZWFmMDA0YTZiNDA4MzYx
10
- MTQ0OGIxZDVhN2M1ZTRmOThkOTRjOGJlMDhlYWNmMTc1NjgxM2NmNWZiMzkz
11
- NWMxNmI0NjBlYjZlOTdlNTFkYmNmNjkzMWNhYWFhZDdiOWRlODg=
9
+ NmViMTNhOTJlOGIxZmY2Yjk5MjEzZGU3M2IyMDgxN2ZjM2VhMWM3MTQ5YTlk
10
+ MmM1YmFlZDI5ZDBjMDVlM2M1MzNhZWRhMWIxMzdmMjZhNGFmNjM4ODJmMWI4
11
+ NmVkNGI5ZWJjYzEwODRjOTYxNGNjNWU5NmQ2YzI0NGRmM2NmNWQ=
12
12
  data.tar.gz: !binary |-
13
- MDY5NzM0OWE4NjZjMjZlNTYyNDZlZjQyZDk3N2EzZTIyMGRlOWRkZGUxZjE2
14
- YmFkNjBhZmFjODU1NWFkYTA5M2JmMjVjOTk3MjA2ZmJmZWIwMGNhNjg3YjYz
15
- ZjdhZDY4MTg3NDI2N2FiYWI0NmM5ZWZlZTY4N2ExYzg2MjNmODM=
13
+ YzM1OGY2MzUxYmViNTY5MjFlYmFlNGIxMTg3MzE1OTQ3YzAxMzY2NTQxYzAw
14
+ MDFjODQxZjY3OWJiYjNhYjhjNjg4YTAxNGIwOGI1YmU2MjAzNTNlMDMzZDQ4
15
+ YTlmYmRmMjc1YTJmZmJlYjI0MDg4M2ZiYjkyYTVlZDVhZTAxY2U=
@@ -415,50 +415,47 @@
415
415
  }
416
416
  }
417
417
 
418
- function ujsLoadPlugins(event) {
419
-
420
- $('.ujs-quick-buttonset input:checked').change();
418
+ function addHiddenField(form, name, value) {
419
+ var input = $('<input type="hidden">');
420
+ input.attr('name', name);
421
+ input.attr('value', value);
422
+ form.append(input);
423
+ }
421
424
 
422
- function addHiddenField(form, name, value) {
423
- var input = $('<input type="hidden">');
424
- input.attr('name', name);
425
- input.attr('value', value);
426
- form.append(input);
425
+ function ujsExternalClick(event) {
426
+ event.stopImmediatePropagation();
427
+ var button = $(this);
428
+ if (!$.rails.allowAction(button)) {
429
+ return false;
430
+ }
431
+ if (button.data('disable-with')) {
432
+ button.html(button.data('disable-with'));
433
+ button.attr('disabled', 'disabled');
434
+ button.attr('autocomplete', 'off');
435
+ }
436
+ var form = $('<form>');
437
+ var method = button.data('method');
438
+ if (method == 'put' || method == 'delete') {
439
+ form.attr('method', 'post');
440
+ addHiddenField(form, '_method', method);
427
441
  }
442
+ else {
443
+ form.attr('method', method);
444
+ }
445
+ form.attr('action', button.data('url'));
446
+ form.attr('target', button.data('target'));
447
+ if (method != 'get') {
448
+ form.attr('rel', 'nofollow');
449
+ addHiddenField(form, button.data('token-name'),
450
+ button.data('token-value'));
451
+ }
452
+ $('body').append(form);
453
+ form.submit();
454
+ return false;
455
+ }
456
+
457
+ function ujsLoadPlugins(event) {
428
458
 
429
- $('.ujs-external-button').each(function() {
430
- var button = $(this);
431
- var form = $('<form>');
432
- var method = button.data('method');
433
- if (method == 'put' || method == 'delete') {
434
- form.attr('method', 'post');
435
- addHiddenField(form, '_method', method);
436
- }
437
- else {
438
- form.attr('method', method);
439
- }
440
- form.attr('action', button.data('url'));
441
- form.attr('target', button.data('target'));
442
- if (method != 'get') {
443
- form.attr('rel', 'nofollow');
444
- addHiddenField(form, button.data('token-name'),
445
- button.data('token-value'));
446
- }
447
- $('body').append(form);
448
- button.click(function(event) {
449
- event.stopImmediatePropagation();
450
- if (!$.rails.allowAction(button)) {
451
- return false;
452
- }
453
- if (button.data('disable-with')) {
454
- button.html(button.data('disable-with'));
455
- button.attr('disabled', 'disabled');
456
- button.attr('autocomplete', 'off');
457
- }
458
- form.submit();
459
- return false;
460
- });
461
- });
462
459
  $('.ujs-date-picker', event.target).each(function() {
463
460
  var options = $(this).data('date-options');
464
461
  $(this).datepicker(options);
@@ -527,6 +524,7 @@
527
524
  $(document).on('mouseenter mouseleave', '.ujs-quick-buttonset label',
528
525
  ujsQuickButtonHover);
529
526
  $(document).on('click', '.ujs-toggle', ujsToggleClick);
527
+ $(document).on('click', '.ujs-external-button', ujsExternalClick);
530
528
  }
531
529
  else {
532
530
  $('body').live('jqr.load', ujsLoadPlugins);
@@ -543,6 +541,7 @@
543
541
  $('.ujs-quick-buttonset label').live('mouseenter mouseleave',
544
542
  ujsQuickButtonHover);
545
543
  $('.ujs-toggle').live('click', ujsToggleClick);
544
+ $('.ujs-external-button').live('click', ujsExternalClick);
546
545
  }
547
546
  $('body').trigger('jqr.beforeload').trigger('jqr.load');
548
547
  });
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.60'
5
- s.date = '2014-09-29'
4
+ s.version = '1.0.61'
5
+ s.date = '2014-10-01'
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
@@ -334,6 +334,7 @@ module JqrHelpers
334
334
  def quick_radio_set(name, values, selected=nil, html_options={})
335
335
  html_options[:class] ||= ''
336
336
  html_options[:class] << ' ujs-quick-buttonset ui-buttonset'
337
+ html_options[:autocomplete] = 'off'
337
338
  content = ''
338
339
  last_key = values.keys.length - 1
339
340
  values.each_with_index do |(value, label), i|
@@ -1,6 +1,6 @@
1
1
  module JqrHelpers
2
2
  # @private
3
3
  module Rails
4
- VERSION = '1.0.60'
4
+ VERSION = '1.0.61'
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.60
4
+ version: 1.0.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement