thin_man 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f132c12483ea0360e3c4a6923c15b578f0889c8
4
- data.tar.gz: aff4a3f9f5e7f8fd9bdde9f500f93b4249d21394
3
+ metadata.gz: 686c4bc3d564f6254c7ff91729a3fb3f309421eb
4
+ data.tar.gz: 72e6b93a39f0f2c6edd23c03c547359a15ca6241
5
5
  SHA512:
6
- metadata.gz: de81b55015f5e970256447843e24e471d9b568ff3dd8e0001194f2d73597d260c5aef3e8ccea18f482f1ddc54381a26ba8ff999793eb86aa36f602a2c0a3e47a
7
- data.tar.gz: 765b27533f13e11c428c0b2c23f86e909f5957e39ad5991b70f06d88f283c01d7bcceff9d7101294f8d56bb8100807bf0243d23a076075ef46424221a309c1fe
6
+ metadata.gz: e3fb89ad519ff717aa47588c837117e922c84d4142f0376a82b9f02acd48ac95abc39fb2220759793435878ae3a0115d5c45a0713d65bf1317791740e141072f
7
+ data.tar.gz: de7eb4294fa77bfe77ca1686fb82271a1148c76607e33ccf23b173c3966a2ab7b2e59fed5d9446e06ec6e74f97894e19e39811eb1a999dfc29c16321bce2f043
@@ -104,9 +104,11 @@ var AjaxSubmission = Class.extend({
104
104
  })
105
105
  }
106
106
  }
107
- var ajax_flash = this.target.children().last().data('ajax-flash');
108
- if((jqXHR.status == 200) && ajax_flash){
109
- new AjaxFlash('success', ajax_flash.notice,this.target);
107
+ if(this.target){
108
+ var ajax_flash = this.target.children().last().data('ajax-flash');
109
+ if((jqXHR.status == 200) && ajax_flash){
110
+ new AjaxFlash('success', ajax_flash.notice,this.target);
111
+ }
110
112
  }
111
113
  if ((jqXHR.status == 200) && !(typeof step === 'undefined')) {
112
114
  $(form_map[step]).ScrollTo();
@@ -125,7 +127,11 @@ var AjaxSubmission = Class.extend({
125
127
  }
126
128
  if(typeof response_data.flash_message != 'undefined'){
127
129
  flash_style = this.httpResponseToFlashStyle(jqXHR.status)
128
- new AjaxFlash(flash_style, response_data.flash_message,this.target);
130
+ if(this.target){
131
+ new AjaxFlash(flash_style, response_data.flash_message,this.target);
132
+ }else{
133
+ new AjaxFlash(flash_style, response_data.flash_message,this.jq_obj);
134
+ }
129
135
  }
130
136
  },
131
137
  ajaxBefore: function(jqXHr) {
@@ -156,7 +162,7 @@ var AjaxSubmission = Class.extend({
156
162
  if([403,409,500].indexOf(response_code) > -1){
157
163
  return 'error'
158
164
  }
159
- if([200].indexOf(response_code) > -1){
165
+ if([200,202].indexOf(response_code) > -1){
160
166
  return 'success'
161
167
  }
162
168
  return 'error'
@@ -355,7 +361,9 @@ var ResetOnSubmitForm = AjaxFormSubmission.extend({
355
361
  var DeleteLink = AjaxSubmission.extend({
356
362
  ajaxSuccess: function(data,textStatus,jqXHR){
357
363
  this._super(data,textStatus,jqXHR);
358
- this.target.remove();
364
+ if(this.target){
365
+ this.target.remove();
366
+ }
359
367
  },
360
368
  getAjaxType: function(){
361
369
  return 'DELETE';
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut, Adam Bialek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails