jqr-helpers 1.0.23 → 1.0.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -205,6 +205,17 @@
205
205
  disableElement = ujsSubmitElement;
206
206
  hideThrobber(disableElement);
207
207
  var targetElement = element;
208
+
209
+ if (element.data('redirect') &&
210
+ (data.indexOf('http') == 0 || data[0] == '/')) {
211
+ window.location = data;
212
+ return;
213
+ }
214
+ else if (!element.data('callback') && data &&
215
+ data.trim().charAt(0) != '<' && data != 'success') {
216
+ alert(data);
217
+ return;
218
+ }
208
219
  // if this was sent from a dialog, close the dialog and look at the
209
220
  // element that opened it for update/append/delete callbacks.
210
221
  if ($('.ui-dialog:visible').length) {
@@ -217,18 +228,10 @@
217
228
  window.location.reload();
218
229
  return;
219
230
  }
220
- else if (element.data('redirect') && data.indexOf('http') == 0) {
221
- window.location = data;
222
- return;
223
- }
224
231
  if (element.data('callback')) {
225
232
  var callback = eval(element.data('callback'));
226
233
  callback.call(targetElement, data);
227
234
  }
228
- else if (data && data.trim().charAt(0) != '<' && data != 'success') {
229
- alert(data);
230
- return;
231
- }
232
235
  var selector = element.data('selector');
233
236
  var target = null;
234
237
  if (selector) {
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.23'
5
- s.date = '2014-01-09'
4
+ s.version = '1.0.24'
5
+ s.date = '2014-01-16'
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.23'
3
+ VERSION = '1.0.24'
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.23
5
+ version: 1.0.24
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-09 00:00:00.000000000 Z
12
+ date: 2014-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails