jqr-helpers 1.0.21 → 1.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,8 +28,14 @@
28
28
 
29
29
  // called from dialog button value
30
30
  function ujsDialogClose() {
31
- $('.ui-dialog-content:visible').dialog('destroy')
32
- .addClass('ujs-dialog-hidden');
31
+ $('.ui-dialog-content:visible').each(function() {
32
+ if ($(this).data('remote-dialog')) {
33
+ $(this).dialog('destroy').remove();
34
+ }
35
+ else {
36
+ $(this).dialog('destroy').addClass('ujs-dialog-hidden');
37
+ }
38
+ });
33
39
  }
34
40
 
35
41
  function ujsDialogOpen() {
@@ -110,6 +116,7 @@
110
116
  $('body').append("<div id='" + dialogID + "'>");
111
117
  dialogElement = $('#' + dialogID);
112
118
  }
119
+ dialogElement.data('remote-dialog', true);
113
120
  dialogElement.load(url, function() {
114
121
  if (closeX) {
115
122
  dialogElement.prepend('<span class="ujs-dialog-x"></span>');
@@ -145,7 +152,8 @@
145
152
  function ujsButtonClick(event) {
146
153
  var element = $(this);
147
154
  element.uniqueId(); // to store for later
148
- if ($.rails.allowAction(element)) {
155
+ // if the button is inside a form, allowAction is already called.
156
+ if ($(this).closest('form').length || $.rails.allowAction(element)) {
149
157
  element.data('confirm', null); // we've already fired it
150
158
  // largely copied from rails_jquery.js
151
159
  var href = element.data('url');
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.21'
5
- s.date = '2014-01-04'
4
+ s.version = '1.0.22'
5
+ s.date = '2014-01-09'
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
1
  module JqrHelpers
2
2
  module Rails
3
- VERSION = '1.0.21'
3
+ VERSION = '1.0.22'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: jqr-helpers
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.21
5
+ version: 1.0.22
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Orner
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-04 00:00:00.000000000 Z
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails