jqr-helpers 1.0.45 → 1.0.46

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
- ZWMxMGYwMjg3MDc1MWFlZmJkMmQwMzljYWJmYzdhYjc3YjQxNjg3Yg==
4
+ NGJmMTIyNTRmNmMxNWMwOWU2YjAzZDZjMTIwOWUwYWE2ZjEyMmIzNg==
5
5
  data.tar.gz: !binary |-
6
- M2RmZTM4YzEyZGUxNzAwYTg2YTI4NDhkMzBlYjJjMzVmODMwNmE5Zg==
6
+ MTY4ZDljZGFkZGE4ODc1M2ZlNzc2NGM5YTc0MDI2ZTVkZTk4ODJlNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWI5YzMxYmJiMmIyYjA2YTY2NTQxMzY2MTU3ZTVhN2M4ZWQ2OGY4OTkxODY1
10
- ODU1OGJjMGJiYjEzMzY0ZTkyM2U2NWRlNTgwZDRjNGFlNGFhOTcwZGJmMDBj
11
- ZDY2NWE4ZGZjOWQxOGE3MGNhMDc3ODY4NWRhZGUwYjljZDQ3YzE=
9
+ NmQ2NDk0NDlkMjgzNTliZjk1NGNmMDAwMzdjMjE1OWFjOGU4OGMyYmY1Mjll
10
+ YTI5ODEzMGJjODQ2ZTM1ODg5YTYyNTlhYWQ0N2RkZTViYThmYmMxODE0ZDNi
11
+ MTgzN2U4NDQ4YzMyOGMwN2RmNjc3YTBkYzU2Y2QwODNiNjEwMzQ=
12
12
  data.tar.gz: !binary |-
13
- NjRlZGMwZGQxYjI0MDAyZTU1ZTc2MTg1ZTU4M2U5ZDZiN2UwY2EwYWQ4M2E2
14
- MTM2MGQxYjUzOGNkOTJmNmYwOTIxM2Q4MzQ4OWVhOTYyMjMzNzVmZjg0NDY1
15
- MWFkZWNjNjU2MDU2NjMxYjBlYzdiZDkxNzZmZTUwY2EyODkzYjM=
13
+ ZmM0MDg5OWQxNGI1NzY3M2UxZDZjMTU0YTYzNjVjMWY2NGQwOGZlMWE0YWFk
14
+ OGEyMDM4MTYxNGQ4MTBhYzljNGI2MTQzMTk2ZWJkYTY5MDNlZTM5ZmFlYzAx
15
+ OTdlMzI5OWI0NDRmMjA0MmUxZTc5M2RmNTYzM2IyNmI3NThjNjk=
@@ -22,7 +22,6 @@
22
22
  $(element).removeAttr('disabled');
23
23
  }
24
24
 
25
- var ujsDialogElement = null; // the element that opened the dialog
26
25
  var ujsSubmitElement = null; // the element that submitted a form
27
26
 
28
27
  // called from dialog button value
@@ -30,12 +29,17 @@
30
29
  $('.ui-dialog:visible form').first().submit();
31
30
  }
32
31
 
32
+ function findDialog(element) {
33
+ var dialog = $(element).closest('.ui-dialog-content');
34
+ if (dialog.length == 0) dialog = $(element).find('.ui-dialog-content');
35
+ if (dialog.length == 0) dialog = $(element).prev('.ui-dialog-content');
36
+ return dialog;
37
+ }
38
+
33
39
  // called from dialog button value
34
40
  // uses $.proxy to set the "this" context
35
41
  function ujsDialogClose() {
36
- var dialog = $(this).closest('.ui-dialog-content');
37
- if (dialog.length == 0) dialog = $(this).find('.ui-dialog-content');
38
- if (dialog.length == 0) dialog = $(this).prev('.ui-dialog-content');
42
+ var dialog = findDialog(this);
39
43
  if (dialog.data('remote-dialog')) {
40
44
  dialog.dialog('destroy').remove();
41
45
  }
@@ -65,7 +69,8 @@
65
69
  }
66
70
 
67
71
  function ujsDialogClick(event) {
68
- ujsDialogElement = $(this);
72
+ $(this).uniqueId();
73
+ var dialogClickID = $(this).prop('id');
69
74
  var dialogID = $(this).data('dialog-id');
70
75
  var dialogElement = $('#' + dialogID);
71
76
  if (dialogID == 'next') dialogElement = $(this).next();
@@ -117,7 +122,7 @@
117
122
  if (url) {
118
123
  $(this).trigger('jqr.beforedialogopen');
119
124
  $(document.body).append('<div class="ui-widget-overlay ui-front">');
120
- showThrobber(ujsDialogElement);
125
+ showThrobber($('#' + dialogClickID));
121
126
  var closeX = $(this).data('close-x');
122
127
  if (dialogElement.length == 0) {
123
128
  $('body').append("<div id='" + dialogID + "'>");
@@ -134,9 +139,10 @@
134
139
  dialogElement.find('.ujs-dialog-title-hidden').text();
135
140
  }
136
141
  $('.ui-widget-overlay').remove();
137
- hideThrobber(ujsDialogElement);
142
+ hideThrobber($('#' + dialogClickID));
138
143
  $('#ujs-dialog-throbber').remove();
139
144
  $(this).dialog(dialogOptions);
145
+ $(this).data('dialog-opener', dialogClickID);
140
146
  $(dialogElement).trigger('jqr.load');
141
147
  });
142
148
  }
@@ -230,8 +236,10 @@
230
236
  // if this was sent from a dialog, close the dialog and look at the
231
237
  // element that opened it for update/append/delete callbacks.
232
238
  if ($('.ui-dialog:visible').length) {
233
- if (element.data('use-dialog-opener'))
234
- targetElement = ujsDialogElement;
239
+ if (element.data('use-dialog-opener')) {
240
+ var dialog = findDialog(this);
241
+ targetElement = $('#' + dialog.data('dialog-opener'));
242
+ }
235
243
  if (element.data('close-dialog'))
236
244
  ujsDialogClose.call(element);
237
245
  }
data/jqr-helpers.gemspec CHANGED
@@ -1,7 +1,7 @@
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.45'
4
+ s.version = '1.0.46'
5
5
  s.date = '2014-06-20'
6
6
  s.summary = 'Helpers to print unobtrusive jQuery-UI tags.'
7
7
  s.description = <<-EOF
@@ -1,6 +1,6 @@
1
1
  module JqrHelpers
2
2
  # @private
3
3
  module Rails
4
- VERSION = '1.0.45'
4
+ VERSION = '1.0.46'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jqr-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.45
4
+ version: 1.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner