foreign_office 0.15.7 → 0.15.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40ac48bf614839677ce97f57df4f2cc1c2a0b31
4
- data.tar.gz: 337949668fcc26dd6e33b1e244960bcab41ab2ab
3
+ metadata.gz: ac5311e95b99a2a57f2554e552053830a930fc2b
4
+ data.tar.gz: c3f597a3a2144cd9711009e0f8546a3b12db7e12
5
5
  SHA512:
6
- metadata.gz: 66e30dd5a93d9072a055280910d86ab313693171a0a7ae1539d582795b5d6069dff221270013ae2dae3bab23ee0957d394a25f840aa88a5aea8f359e10c5434f
7
- data.tar.gz: faec1749dd0db075969b47e0f9590821308d2dc393abdb6868641917800a0c48878c64a84a3cd74eb0edeca1e89a474fcc5f47c7d65d7afe5ef7ecb7728815ce
6
+ metadata.gz: 13a08132e1ef73d9c26e00f5c6145b06d39529c17c40efbfc062e7db4432d3ad2a38cad2dfcd6f81010a4ff87e61cb9295aaffce080a425d048d8254507aa785
7
+ data.tar.gz: eb9ea8764112495cc2360ae81858a3068ed08691558189145f066c2812a5af88514b850b23583583b6100b81cf7987e0040b892119c67b412dda4da3609bf75b
@@ -154,14 +154,24 @@ var ForeignOfficeListener = Class.extend({
154
154
  }
155
155
  if(this.endpoint){
156
156
  if (m.object[this.object_key] == true) {
157
+ let $progress_target = null
158
+ if($listener.data('progress-target').length > 0){
159
+ $progress_target = $($listener.data('progress-target'))
160
+ }
161
+ let progress_indicator = new thin_man.AjaxProgress($progress_target,$listener,'black')
157
162
  $.get(this.endpoint, function(data){
158
163
  $listener.html(data);
164
+ }).always(function(){
165
+ progress_indicator.stop()
159
166
  })
160
167
  }else if(m.object[this.object_key] == false) {
161
168
  $listener.empty();
162
169
  }else if(typeof(m.object[this.object_key]) == 'string'){
170
+ let progress_indicator = new thin_man.AjaxProgress($listener,$listener,'black')
163
171
  $.get(m.object[this.object_key], function(data){
164
172
  $listener.html(data);
173
+ }).always(function(){
174
+ progress_indicator.stop()
165
175
  })
166
176
  }
167
177
  if (m.object[this.delete_key] == true) {
@@ -1,6 +1,6 @@
1
1
  module ForeignOffice
2
2
  module ForeignOfficeHelper
3
- def listener_attrs(resource, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil)
3
+ def listener_attrs(resource, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
4
4
  data_attrs = "data-listener=true data-channel=#{resource.class.name}#{resource.id}"
5
5
  if delete
6
6
  data_attrs += " data-delete-key=#{key}"
@@ -11,11 +11,12 @@ module ForeignOffice
11
11
  data_attrs += " data-endpoint=#{endpoint}" if endpoint
12
12
  data_attrs += " data-trigger-on-message=true" if trigger
13
13
  data_attrs += " data-href-target=true" if href_target
14
+ data_attrs += " data-progress-target=#{progress_target}" if progress_target
14
15
  data_attrs += " data-create-modal=#{create_modal}" if create_modal
15
16
  data_attrs
16
17
  end
17
18
 
18
- def listener_attrs_raw(channel, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil)
19
+ def listener_attrs_raw(channel, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
19
20
  data_attrs = "data-listener=true data-channel=#{channel}"
20
21
  if delete
21
22
  data_attrs += " data-delete-key=#{key}"
@@ -26,11 +27,12 @@ module ForeignOffice
26
27
  data_attrs += " data-endpoint=#{endpoint}" if endpoint
27
28
  data_attrs += " data-trigger-on-message=true" if trigger
28
29
  data_attrs += " data-href-target=true" if href_target
30
+ data_attrs += " data-progress-target=#{progress_target}" if progress_target
29
31
  data_attrs += " data-create-modal=#{create_modal}" if create_modal
30
32
  data_attrs
31
33
  end
32
34
 
33
- def listener_hash(resource, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil)
35
+ def listener_hash(resource, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
34
36
  hash = {listener: true, channel: resource.class.name + resource.id.to_s}
35
37
  if delete
36
38
  hash[:delete_key] = key
@@ -42,10 +44,11 @@ module ForeignOffice
42
44
  hash[:trigger_on_message] = true if trigger
43
45
  hash[:href_target] = true if href_target
44
46
  hash[:create_modal] = create_modal if create_modal
47
+ hash[:progress_target] = progress_target if progress_target
45
48
  hash
46
49
  end
47
50
 
48
- def listener_hash_raw(channel, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil)
51
+ def listener_hash_raw(channel, key, reveal_hide: false, endpoint: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
49
52
  hash = {listener: true, channel: channel}
50
53
  if delete
51
54
  hash[:delete_key] = key
@@ -57,6 +60,7 @@ module ForeignOffice
57
60
  hash[:trigger_on_message] = true if trigger
58
61
  hash[:href_target] = true if href_target
59
62
  hash[:create_modal] = create_modal if create_modal
63
+ hash[:progress_target] = progress_target if progress_target
60
64
  hash
61
65
  end
62
66
  end
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.15.7"
2
+ VERSION = "0.15.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreign_office
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.7
4
+ version: 0.15.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-18 00:00:00.000000000 Z
12
+ date: 2017-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails