thin_man 0.11.7 → 0.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/thin_man.js +2 -0
- data/lib/thin_man/version.rb +1 -1
- data/test/javascript/spec/thinManSpec.js +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8a5fa590943be5c0a381ad8ee14457e54925d94
|
4
|
+
data.tar.gz: 1ed6481c6f18b1be9b40edbd7ea3c4c3a6de73c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed16af073355f679dddd1e93b855deb3fc36f4e882cb4e5dfff66f905a8a9ae929942c1ac70329591100eb5763d41f1334174a304217e926bd30d6ce63f956e1
|
7
|
+
data.tar.gz: e52cd78c0e44e84ff8acb77770bcd8e425e2bae87d605e746043291d75ce782b1ea4d8359c2969e5f7e306b44df64de804086794ecad5c29875e43ce3f2708db
|
@@ -88,6 +88,8 @@ var initThinMan = function(){
|
|
88
88
|
} else if(typeof data === 'object') {
|
89
89
|
if(typeof data.html != 'undefined'){
|
90
90
|
this.insertHtml(data.html)
|
91
|
+
} else {
|
92
|
+
this.target.empty()
|
91
93
|
}
|
92
94
|
if(typeof data.class_triggers != 'undefined'){
|
93
95
|
$.each(data.class_triggers, function(class_name, params){
|
data/lib/thin_man/version.rb
CHANGED
@@ -32,6 +32,12 @@ describe("thin_man", function(){
|
|
32
32
|
//Check if it's focused
|
33
33
|
expect($("[type='text']").get(0)).toBe(document.activeElement);
|
34
34
|
});
|
35
|
+
|
36
|
+
it("empties the target if there is no html in the json", function(){
|
37
|
+
$target.html('Remove me.')
|
38
|
+
thin.ajaxSuccess({flash_message: 'Successfully moved the widget.'}, 'success', TestResponses.success)
|
39
|
+
expect($target.html()).toEqual('')
|
40
|
+
})
|
35
41
|
});
|
36
42
|
|
37
43
|
describe(".ajaxComplete", function(){
|
@@ -67,7 +73,8 @@ describe("thin_man", function(){
|
|
67
73
|
var $link, thin;
|
68
74
|
|
69
75
|
beforeEach(function(){
|
70
|
-
$link = affix('a[data-ajax-link="true"][data-ajax-target="#test_dom_id"]
|
76
|
+
$link = affix('a[data-ajax-link="true"][data-ajax-target="#test_dom_id"]');
|
77
|
+
$target = affix('#test_dom_id');
|
71
78
|
thin = new thin_man.AjaxLinkSubmission($link);
|
72
79
|
});
|
73
80
|
|
@@ -80,6 +87,13 @@ describe("thin_man", function(){
|
|
80
87
|
thin.ajaxError(TestResponses.conflict);
|
81
88
|
expect($('#test_dom_id').html()).toMatch('Required field');
|
82
89
|
});
|
90
|
+
|
91
|
+
it("empties the target if there is no html in the json", function(){
|
92
|
+
$target.affix('#remove_me')
|
93
|
+
thin.ajaxError(TestResponses.conflictNoHtml)
|
94
|
+
expect($('#test_dom_id').children().length).toEqual(0)
|
95
|
+
})
|
96
|
+
|
83
97
|
});
|
84
98
|
});
|
85
99
|
|
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.11.
|
4
|
+
version: 0.11.8
|
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-10-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|