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 +8 -8
- data/app/assets/javascripts/jqr-helpers.js +17 -9
- data/jqr-helpers.gemspec +1 -1
- data/lib/jqr-helpers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGJmMTIyNTRmNmMxNWMwOWU2YjAzZDZjMTIwOWUwYWE2ZjEyMmIzNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTY4ZDljZGFkZGE4ODc1M2ZlNzc2NGM5YTc0MDI2ZTVkZTk4ODJlNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmQ2NDk0NDlkMjgzNTliZjk1NGNmMDAwMzdjMjE1OWFjOGU4OGMyYmY1Mjll
|
10
|
+
YTI5ODEzMGJjODQ2ZTM1ODg5YTYyNTlhYWQ0N2RkZTViYThmYmMxODE0ZDNi
|
11
|
+
MTgzN2U4NDQ4YzMyOGMwN2RmNjc3YTBkYzU2Y2QwODNiNjEwMzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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 =
|
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
|
-
|
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(
|
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(
|
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
|
-
|
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
data/lib/jqr-helpers/version.rb
CHANGED