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 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
@@ -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.22'
4
+ s.version = '1.0.23'
5
5
  s.date = '2014-01-09'
6
6
  s.summary = 'Helpers to print unobtrusive jQuery-UI tags.'
7
7
  s.description = <<-EOF
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module JqrHelpers
2
2
  module Rails
3
- VERSION = '1.0.22'
3
+ VERSION = '1.0.23'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jqr-helpers
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.22
5
+ version: 1.0.23
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Orner