thin_man 0.15.6 → 0.15.7

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: 373fee9d1af3e08f436b8c8c523d74548fe72220
4
- data.tar.gz: fb31a388438fb06ca08041272ce0176785d51305
3
+ metadata.gz: 71de9e24b17fcf6f8ce9970711290e3e3cf45918
4
+ data.tar.gz: 240679f9a47363b2dab81b86a79ccdbc4e8a76c8
5
5
  SHA512:
6
- metadata.gz: f5d5b86b4e62db5b314253783b219b29f76ae081544c6baa424f804680a954a4fed63f1bc58d9f785cae205dcf8cf1bb1c252c54eefc4404928f9f5355d180e3
7
- data.tar.gz: c78d106d8b01b32d333332064baaa713e3094505f0058eadf3aa5f43c030bd536eeaca853202c75bab3e8af6289ffc848fce3fd04fe6b94a777ad4a63d4d6038
6
+ metadata.gz: 93baad307f7be01ddf604a1b29218b0c7bedf1fd39672010986c7c8a16836f9afdd6b6bb1ff5b9ca1ffd8b30fd928508131557d858994ad5b3efe89330aae81c
7
+ data.tar.gz: fea0cc3ff26b37b013ff70cc5dc48c6d103d9baba0fe12a95a03dbb110ebb21c85a6ff52a6d805b4d13ee49e338337ee6573de6ac85c9674b01adb84034025ac
@@ -270,23 +270,19 @@ var initThinMan = function(){
270
270
  } else {
271
271
  this.progress_target = $('body');
272
272
  }
273
- if(!progress_color){
274
- progress_color = 'black';
273
+ if(typeof(progress_color) == 'undefined'){
274
+ var progress_color = 'black';
275
275
  }
276
276
  this.progress_container = $('#ajax_progress_container').clone();
277
277
  uuid = new UUID;
278
278
  this.progress_container.prop('id', 'thin_man_ajax_progress_' + uuid.value);
279
279
  this.progress_target.append(this.progress_container);
280
280
  var css = {display: 'block', visibility: 'visible','color': progress_color, 'z-index': 1000000}
281
- if(this.progress_target.css('position') == 'absolute' || this.progress_target.css('position') == 'relative'){
282
- $.extend(css,
283
- {position: 'absolute', top: '50%', left: '50%',
284
- '-ms-transform': 'translate(-50%, -50%)', /* IE 9 */
285
- '-webkit-transform': 'translate(-50%, -50%)', /* Safari */
286
- 'transform': 'translate(-50%, -50%)'})
287
- } else {
288
- $.extend(css, {position: 'absolute', top: 0, left: 0})
289
- }
281
+ $.extend(css,
282
+ {position: 'absolute', top: '50%', left: '50%',
283
+ '-ms-transform': 'translate(-50%, -50%)', /* IE 9 */
284
+ '-webkit-transform': 'translate(-50%, -50%)', /* Safari */
285
+ 'transform': 'translate(-50%, -50%)'})
290
286
  this.progress_container.css(css)
291
287
  },
292
288
  stop: function(){
@@ -422,6 +418,9 @@ var initThinMan = function(){
422
418
  },
423
419
  getTrigger: function(){
424
420
  this.trigger = this.jq_obj.find('button, input[type="submit"]');
421
+ if(this.trigger.length != 1){
422
+ this.trigger = $(document.activeElement)
423
+ }
425
424
  },
426
425
  hideTrigger: function(){
427
426
  this.trigger.css('visibility','hidden');
@@ -563,7 +562,6 @@ var initThinMan = function(){
563
562
  });
564
563
 
565
564
  window.any_time_manager.registerListWithClasses({'sortable' : 'AjaxSorter', 'ajax-link-now' : 'AjaxLinkSubmission', 'ajax-form-now' : 'AjaxFormSubmission'},'thin_man');
566
- window.any_time_manager.load();
567
565
 
568
566
  $(document).ready(function(){
569
567
  $(document).on('click apiclick','[data-ajax-link],[data-ajax-link-now]',function(e){
@@ -766,8 +764,7 @@ if(typeof window.any_time_manager === "undefined" && typeof window.loading_any_t
766
764
  });
767
765
  }
768
766
  window.any_time_manager.load();
769
- });
770
-
767
+ })
771
768
  // End AnyTime library
772
769
  }
773
770
 
@@ -1,6 +1,6 @@
1
1
  module ThinMan
2
2
  module AjaxHelper
3
- def ajax_link(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil, http_method: nil, no_mouse_click: nil)
3
+ def ajax_link(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil, http_method: nil, no_mouse_click: nil, progress_target: nil)
4
4
  ajax_options = {
5
5
  'data-ajax-link' => true,
6
6
  'data-ajax-target' => target
@@ -10,12 +10,13 @@ module ThinMan
10
10
  ajax_options.merge!('data-ajax-method' => http_method) if http_method.present?
11
11
  ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
12
12
  ajax_options.merge!('data-no-mouse-click' => no_mouse_click) if no_mouse_click.present?
13
+ ajax_options.merge!('data-progress-target' => progress_target) if progress_target.present?
13
14
  link_to(name,
14
15
  options,
15
16
  html_options.merge(ajax_options))
16
17
  end
17
18
 
18
- def ajax_link_now(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil, http_method: nil)
19
+ def ajax_link_now(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil, http_method: nil, progress_target: nil)
19
20
  ajax_options = {
20
21
  'data-ajax-link-now' => true,
21
22
  'data-ajax-target' => target
@@ -24,6 +25,7 @@ module ThinMan
24
25
  ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
25
26
  ajax_options.merge!('data-ajax-method' => http_method) if http_method.present?
26
27
  ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
28
+ ajax_options.merge!('data-progress-target' => progress_target) if progress_target.present?
27
29
  link_to(name,
28
30
  options,
29
31
  html_options.merge(ajax_options))
@@ -44,7 +46,7 @@ module ThinMan
44
46
  html_options.merge(ajax_options))
45
47
  end
46
48
 
47
- def ajax_form_hash(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, container: nil, custom_progress: nil, no_mouse_click: nil)
49
+ def ajax_form_hash(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, container: nil, custom_progress: nil, no_mouse_click: nil, progress_target: nil)
48
50
  ajax_options = {
49
51
  'data-ajax-form' => true,
50
52
  'data-ajax-target' => target
@@ -57,10 +59,11 @@ module ThinMan
57
59
  ajax_options.merge!('data-reset-on-success' => reset_on_success) if reset_on_success.present?
58
60
  ajax_options.merge!('data-custom-progress' => custom_progress) if custom_progress.present?
59
61
  ajax_options.merge!('data-no-mouse-click' => no_mouse_click) if no_mouse_click.present?
62
+ ajax_options.merge!('data-progress-target' => progress_target) if progress_target.present?
60
63
  ajax_options
61
64
  end
62
65
 
63
- def ajax_form_now(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, container: nil, custom_progress: nil)
66
+ def ajax_form_now(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, container: nil, custom_progress: nil, progress_target: nil)
64
67
  ajax_options = {
65
68
  'data-ajax-form-now' => true,
66
69
  'data-ajax-target' => target
@@ -72,10 +75,11 @@ module ThinMan
72
75
  ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
73
76
  ajax_options.merge!('data-reset-on-success' => reset_on_success) if reset_on_success.present?
74
77
  ajax_options.merge!('data-custom-progress' => custom_progress) if custom_progress.present?
78
+ ajax_options.merge!('data-progress-target' => progress_target) if progress_target.present?
75
79
  ajax_options
76
80
  end
77
81
 
78
- def ajax_form_attrs(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, no_mouse_click: nil)
82
+ def ajax_form_attrs(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, no_mouse_click: nil, progress_target: nil)
79
83
  data_attrs = "data-ajax-form=true data-ajax-target=#{target}"
80
84
  data_attrs += " data-insert-method=#{insert_method}" if insert_method
81
85
  data_attrs += " data-sub-type=#{sub_class}" if sub_class
@@ -83,26 +87,29 @@ module ThinMan
83
87
  data_attrs += " data-reset-on-success=#{reset_on_success}" if reset_on_success
84
88
  data_attrs += " data-error-target=#{error_target}" if error_target
85
89
  data_attrs += " data-no-mouse-click=#{no_mouse_click}" if no_mouse_click
90
+ data_attrs += " data-progress-target=#{progress_target}" if progress_target
86
91
  data_attrs
87
92
  end
88
93
 
89
- def ajax_form_now_attrs(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil)
94
+ def ajax_form_now_attrs(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil, reset_on_success: nil, progress_target: nil)
90
95
  data_attrs = "data-ajax-form-now=true data-ajax-target=#{target}"
91
96
  data_attrs += " data-insert-method=#{insert_method}" if insert_method
92
97
  data_attrs += " data-sub-type=#{sub_class}" if sub_class
93
98
  data_attrs += " data-empty-on-success=#{empty_on_success}" if empty_on_success
94
99
  data_attrs += " data-reset-on-success=#{reset_on_success}" if reset_on_success
95
100
  data_attrs += " data-error-target=#{error_target}" if error_target
101
+ data_attrs += " data-progress-target=#{progress_target}" if progress_target
96
102
  data_attrs
97
103
  end
98
104
 
99
- def ajax_link_attrs(target, insert_method: nil, sub_type: nil, empty_on_success: nil, http_method: nil, no_mouse_click: nil)
105
+ def ajax_link_attrs(target, insert_method: nil, sub_type: nil, empty_on_success: nil, http_method: nil, no_mouse_click: nil, progress_target: nil)
100
106
  data_attrs = "data-ajax-link=true data-ajax-target=#{target}"
101
107
  data_attrs += " data-insert-method=#{insert_method}" if insert_method
102
108
  data_attrs += " data-ajax-method=#{http_method}" if http_method
103
109
  data_attrs += " data-sub-type=#{sub_type}" if sub_type
104
110
  data_attrs += " data-empty-on-success=#{empty_on_success}" if empty_on_success
105
111
  data_attrs += " data-no-mouse-click=#{no_mouse_click}" if no_mouse_click
112
+ data_attrs += " data-progress-target=#{progress_target}" if progress_target
106
113
  data_attrs
107
114
  end
108
115
 
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.15.6"
2
+ VERSION = "0.15.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.15.6
4
+ version: 0.15.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: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails