thin_man 0.20.3 → 0.20.4
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 +27 -18
- data/lib/thin_man/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40dff39c348f32f4f43c034eb305c87691abcd113a50cb618248a3e28ef0b023
|
4
|
+
data.tar.gz: 90ae3bf0fb8632f36988681b4dfeef6adbc0c3d69bca16f4396afebcddb1924b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c92fb9b47e882d1aa7cb4006086367519b8eaec37f12f4cf4a8e8f8657b74028c175f0855ce77379f9927227bdd9777ee201a70dfcb8a2907080a8b9efcaa83
|
7
|
+
data.tar.gz: a06040297179ba28373aefd2cc77344866995cd34f629c961875bda0186e65e9c89766c36bce77d3cdee294a85f56b916e578a6d623050d0c366eedddcf50980
|
@@ -131,12 +131,12 @@ var initThinMan = function() {
|
|
131
131
|
}
|
132
132
|
},
|
133
133
|
getTarget: function() {
|
134
|
-
|
135
|
-
if (target_selector) {
|
136
|
-
if ($(target_selector).length > 0) {
|
137
|
-
this.target = $(target_selector);
|
134
|
+
this.target_selector = this.jq_obj.data('ajax-target');
|
135
|
+
if (this.target_selector) {
|
136
|
+
if ($(this.target_selector).length > 0) {
|
137
|
+
this.target = $(this.target_selector);
|
138
138
|
} else {
|
139
|
-
console.log('Warning! Thin Man selector ' + target_selector + ' not found')
|
139
|
+
console.log('Warning! Thin Man selector ' + this.target_selector + ' not found')
|
140
140
|
}
|
141
141
|
} else {
|
142
142
|
console.log('Warning! Thin Man selector not given')
|
@@ -283,14 +283,16 @@ var initThinMan = function() {
|
|
283
283
|
this.replacement_path = this.replacement_path.slice(1)
|
284
284
|
}
|
285
285
|
var new_url = [location.protocol, '//', location.host, '/', this.replacement_path].join('')
|
286
|
-
|
286
|
+
var new_path = '/' + this.replacement_path
|
287
|
+
history['replaceState']({path: new_path, target: this.target_selector, thin_man: true}, null, new_url);
|
287
288
|
},
|
288
|
-
handlePushState: function(){
|
289
|
+
handlePushState: function(){//TODO must implement onPopState handler which is commented out below
|
289
290
|
if('/' === this.push_path[0]){
|
290
291
|
this.push_path = this.push_path.slice(1)
|
291
292
|
}
|
292
293
|
var new_url = [location.protocol, '//', location.host, '/', this.push_path].join('')
|
293
|
-
|
294
|
+
var new_path = '/' + this.push_path
|
295
|
+
history['pushState']({path: new_path, target: this.target_selector, thin_man: true}, null, new_url);
|
294
296
|
|
295
297
|
},
|
296
298
|
addWatcher: function(watcher) {
|
@@ -888,16 +890,23 @@ var initThinMan = function() {
|
|
888
890
|
new thin_man.AjaxSorter($(this));
|
889
891
|
});
|
890
892
|
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
893
|
+
// TODO, make this work to reload content when history changes to previous content loaded by thin_man
|
894
|
+
// and recorded in browser history with pustState
|
895
|
+
// $(window).bind("popstate", function(e){
|
896
|
+
// $('[data-thin-man-back-link]').remove()
|
897
|
+
// var previous_state = e.originalEvent.state
|
898
|
+
// if(previous_state.thin_man && previous_state.path && previous_state.target){
|
899
|
+
// if($(previous_state.target).length > 0){
|
900
|
+
// var $this_target = $(previous_state.target)
|
901
|
+
// }
|
902
|
+
// var $reload_link = $('<div>').
|
903
|
+
// css({display: 'none'}).
|
904
|
+
// attr('data-ajax-target',$this_target).
|
905
|
+
// attr('href',previous_state.path).
|
906
|
+
// attr('data-thin-man-back-link',true)
|
907
|
+
// new thin_man.AjaxLinkSubmission($reload_link)
|
908
|
+
// }
|
909
|
+
// })
|
901
910
|
|
902
911
|
});
|
903
912
|
|
data/lib/thin_man/version.rb
CHANGED
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.20.
|
4
|
+
version: 0.20.4
|
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: 2018-
|
11
|
+
date: 2018-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|