jqr-helpers 1.0.22 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +6 -0
- data/app/assets/javascripts/jqr-helpers.js +4 -0
- data/jqr-helpers.gemspec +1 -1
- data/lib/jqr-helpers/helpers.rb +1 -0
- data/lib/jqr-helpers/version.rb +1 -1
- metadata +1 -1
data/Readme.md
CHANGED
@@ -124,6 +124,12 @@ Other Ajax options:
|
|
124
124
|
The function will be in the scope of the original element, and
|
125
125
|
will be passed the result data of the Ajax request.
|
126
126
|
* `:refresh` (Boolean) - refresh the current page when the call is completed.
|
127
|
+
This will cause `:update, :append, :delete,` `redirect`,
|
128
|
+
and `:callback` to be ignored.
|
129
|
+
* `redirect` (Boolean) - redirect the browser to the URL returned by the
|
130
|
+
server. This will check the returned data - if it begins with either "http"
|
131
|
+
or "/", it will consider it a success and do the redirect. Otherwise, it will
|
132
|
+
alert an error as usual.
|
127
133
|
This will cause `:update, :append, :delete,` and `:callback` to be ignored.
|
128
134
|
* `:use_dialog_opener` (Boolean) - if the Ajax request is sent from inside
|
129
135
|
a dialog, this indicates that the update/append/delete options should
|
@@ -217,6 +217,10 @@
|
|
217
217
|
window.location.reload();
|
218
218
|
return;
|
219
219
|
}
|
220
|
+
else if (element.data('redirect') && data.indexOf('http') == 0) {
|
221
|
+
window.location = data;
|
222
|
+
return;
|
223
|
+
}
|
220
224
|
if (element.data('callback')) {
|
221
225
|
var callback = eval(element.data('callback'));
|
222
226
|
callback.call(targetElement, data);
|
data/jqr-helpers.gemspec
CHANGED
data/lib/jqr-helpers/helpers.rb
CHANGED
@@ -459,6 +459,7 @@ module JqrHelpers
|
|
459
459
|
new_options[:'data-close-dialog'] = options.delete(:close_dialog)
|
460
460
|
new_options[:'data-use-dialog-opener'] = options.delete(:use_dialog_opener)
|
461
461
|
new_options[:'data-refresh'] = true if options.delete(:refresh)
|
462
|
+
new_options[:'data-redirect'] = true if options.delete(:redirect)
|
462
463
|
new_options[:'data-scroll-to'] = true if options.delete(:scroll_to)
|
463
464
|
new_options[:'data-throbber'] = options.delete(:throbber) || 'small'
|
464
465
|
|
data/lib/jqr-helpers/version.rb
CHANGED