app/assets/javascripts/thin_man.js in thin_man-0.15.7 vs app/assets/javascripts/thin_man.js in thin_man-0.15.8

- old
+ new

@@ -21,11 +21,11 @@ this.getTarget(); this.getErrorTarget(); this.progress_color = jq_obj.data('progress-color'); this.progress_target = $(jq_obj.data('progress-target')); this.custom_progress = typeof(jq_obj.data('custom-progress')) != 'undefined'; - if(this.progress_target.length == 0){ + if(this.progress_target.length == 0 && this.trigger.length > 0){ this.progress_target = this.trigger this.trigger_is_progress_target = true } this.insert_method = this.getInsertMethod(); var ajax_submission = this; @@ -417,10 +417,13 @@ } }, getTrigger: function(){ this.trigger = this.jq_obj.find('button, input[type="submit"]'); if(this.trigger.length != 1){ - this.trigger = $(document.activeElement) + var $active_element = $(document.activeElement) + if($active_element[0].nodeName.toLowerCase() != 'body'){ + this.trigger = $active_element + } } }, hideTrigger: function(){ this.trigger.css('visibility','hidden'); },