Add too fast load protection (yes it exists)
This commit is contained in:
@@ -16,8 +16,14 @@ export default Ember.Component.extend
|
||||
contentType: "application/json"
|
||||
dataType: "json"
|
||||
success: (response) ->
|
||||
debugger
|
||||
console.log response
|
||||
#debugger
|
||||
#console.log response
|
||||
finish_time = new Date()
|
||||
action_info_load_time = finish_time - start_time
|
||||
console.log "Action info for action #{identifier} loaded (#{Math.round(action_info_load_time / 100) / 10}s)"
|
||||
if action_info_load_time < 500 # too fast response will not be shown due to fade in effect (I think)
|
||||
setTimeout((-> popup.setSemanticAttr('html', response)), 500)
|
||||
else
|
||||
popup.setSemanticAttr('html', response)
|
||||
if Ember.get(session, 'isAuthenticated')
|
||||
session.authorize 'authorizer:devise', (key, authorization) ->
|
||||
|
||||
@@ -20,9 +20,17 @@ export default Ember.Component.extend({
|
||||
contentType: "application/json",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
debugger;
|
||||
console.log(response);
|
||||
var action_info_load_time, finish_time;
|
||||
finish_time = new Date();
|
||||
action_info_load_time = finish_time - start_time;
|
||||
console.log("Action info for action " + identifier + " loaded (" + (Math.round(action_info_load_time / 100) / 10) + "s)");
|
||||
if (action_info_load_time < 500) {
|
||||
return setTimeout((function() {
|
||||
return popup.setSemanticAttr('html', response);
|
||||
}), 500);
|
||||
} else {
|
||||
return popup.setSemanticAttr('html', response);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (Ember.get(session, 'isAuthenticated')) {
|
||||
|
||||
Reference in New Issue
Block a user