thin_man 0.8.2 → 0.8.3
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 +28 -17
- data/lib/thin_man/version.rb +1 -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: 5df29ef38fa8b6688d3e989af53e83a2f5745d8e
|
4
|
+
data.tar.gz: 40a496e8a349156d8435d069bb26eb0fb1d40cf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be35d972310ef4809f5f539859c6f97d495ad1c228dc04a038d88e816b47c5819a1344900e37d001981cfa3d89a9c895dc0d20da0595cfa2a34af69ee6ab64fb
|
7
|
+
data.tar.gz: 38f28ff004c1c560860860356efcf551ac0b1aa8198263e4293969dfa8a82c60c575e8e8342f12432336b62bb874a295ce278e54bc3e1c3da5f5186ae80863d4
|
@@ -16,6 +16,11 @@ var initThinMan = function(){
|
|
16
16
|
this.getTrigger();
|
17
17
|
this.getTarget();
|
18
18
|
this.getErrorTarget();
|
19
|
+
this.progress_color = jq_obj.data('progress-color');
|
20
|
+
this.progress_target = jq_obj.data('progress_target');
|
21
|
+
if(!this.progress_target){
|
22
|
+
this.progress_target = this.trigger
|
23
|
+
}
|
19
24
|
this.insert_method = this.getInsertMethod();
|
20
25
|
var ajax_submission = this;
|
21
26
|
this.ajax_options = {
|
@@ -145,7 +150,7 @@ var initThinMan = function(){
|
|
145
150
|
},
|
146
151
|
ajaxBefore: function(jqXHr) {
|
147
152
|
this.toggleLoading();
|
148
|
-
this.progress_indicator = new thin_man.AjaxProgress(this.
|
153
|
+
this.progress_indicator = new thin_man.AjaxProgress(this.progress_target,this.target,this.progress_color);
|
149
154
|
},
|
150
155
|
ajaxError: function(jqXHR) {
|
151
156
|
if(jqXHR.status == 409){
|
@@ -160,10 +165,10 @@ var initThinMan = function(){
|
|
160
165
|
toggleLoading: function() {
|
161
166
|
if(this.target){
|
162
167
|
if (this.target.find('[data-loading-visible="false"]').length > 0) {
|
163
|
-
this.target.find('[data-loading-visible="false"]').
|
168
|
+
this.target.find('[data-loading-visible="false"]').hide();
|
164
169
|
}
|
165
170
|
if (this.target.find('[data-loading-visible="true"]').length > 0) {
|
166
|
-
this.target.find('[data-loading-visible="true"]').
|
171
|
+
this.target.find('[data-loading-visible="true"]').show();
|
167
172
|
}
|
168
173
|
}
|
169
174
|
},
|
@@ -189,7 +194,7 @@ var initThinMan = function(){
|
|
189
194
|
if(this.trigger.length < 1){
|
190
195
|
this.trigger = $connector;
|
191
196
|
}
|
192
|
-
this.browser_push_progress_indicator = new thin_man.AjaxProgress(this.trigger);
|
197
|
+
this.browser_push_progress_indicator = new thin_man.AjaxProgress(this.trigger,this.trigger,this.progress_color);
|
193
198
|
$connector.data('browser-push-progress-indicator-object', this.browser_push_progress_indicator);
|
194
199
|
}
|
195
200
|
}),
|
@@ -201,22 +206,28 @@ var initThinMan = function(){
|
|
201
206
|
}
|
202
207
|
}),
|
203
208
|
AjaxProgress: Class.extend({
|
204
|
-
init: function(target){
|
205
|
-
if(target.
|
206
|
-
var
|
209
|
+
init: function(target,alt,progress_color){
|
210
|
+
if(target.length == 0){
|
211
|
+
var progress_target = alt;
|
212
|
+
} else if(alt.length > 0) {
|
213
|
+
var progress_target = target;
|
207
214
|
} else {
|
208
|
-
var
|
215
|
+
var progress_target = $(window);
|
209
216
|
}
|
210
|
-
if(
|
211
|
-
|
212
|
-
var targetTop = targetOffset.top;
|
213
|
-
this.progress_container = $('#ajax_progress_container').clone();
|
214
|
-
uuid = new UUID;
|
215
|
-
this.progress_container.prop('id', uuid.value);
|
216
|
-
$('body').append(this.progress_container);
|
217
|
-
this.progress_container.css({position:'absolute',left: targetLeft, top: targetTop});
|
218
|
-
this.progress_container.show();
|
217
|
+
if(!progress_color){
|
218
|
+
progress_color = 'black';
|
219
219
|
}
|
220
|
+
this.progress_container = $('#ajax_progress_container').clone();
|
221
|
+
uuid = new UUID;
|
222
|
+
this.progress_container.prop('id', uuid.value);
|
223
|
+
progress_target.append(this.progress_container);
|
224
|
+
this.progress_container.css({
|
225
|
+
display: 'block', visibility: 'visible', position: 'absolute', top: '50%', left: '50%',
|
226
|
+
'color': progress_color, 'z-index': 1000000,
|
227
|
+
'-ms-transform': 'translate(-50%, -50%)', /* IE 9 */
|
228
|
+
'-webkit-transform': 'translate(-50%, -50%)', /* Safari */
|
229
|
+
'transform': 'translate(-50%, -50%)'
|
230
|
+
})
|
220
231
|
},
|
221
232
|
stop: function(){
|
222
233
|
if(this.progress_container){
|
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.8.
|
4
|
+
version: 0.8.3
|
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-
|
11
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|