diff --git a/addon/components/panda-action-identifier-info-popup.coffee b/addon/components/panda-action-identifier-info-popup.coffee index 6142352..9c14466 100644 --- a/addon/components/panda-action-identifier-info-popup.coffee +++ b/addon/components/panda-action-identifier-info-popup.coffee @@ -16,9 +16,15 @@ export default Ember.Component.extend contentType: "application/json" dataType: "json" success: (response) -> - debugger - console.log response - popup.setSemanticAttr('html', 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) -> request.crossDomain = true diff --git a/addon/components/panda-action-identifier-info-popup.js b/addon/components/panda-action-identifier-info-popup.js index 18cee6e..bf71415 100644 --- a/addon/components/panda-action-identifier-info-popup.js +++ b/addon/components/panda-action-identifier-info-popup.js @@ -20,9 +20,17 @@ export default Ember.Component.extend({ contentType: "application/json", dataType: "json", success: function(response) { - debugger; - console.log(response); - return popup.setSemanticAttr('html', 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')) {