mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
ToolForm: Use default closing behaviour for progress modal
This commit is contained in:
@@ -35,7 +35,7 @@ return Backbone.Model.extend({
|
||||
|
||||
// show progress modal
|
||||
var user_is_waiting = true;
|
||||
this.app.modal.show({title: 'Please wait...', body: 'progress', closing_events: true, buttons: {
|
||||
this.app.modal.show({title: 'Please wait...', body: 'progress', buttons: {
|
||||
'Close' : function () {
|
||||
self.app.modal.hide();
|
||||
user_is_waiting = false;
|
||||
|
||||
@@ -35,7 +35,7 @@ return Backbone.Model.extend({
|
||||
|
||||
// show progress modal
|
||||
var user_is_waiting = true;
|
||||
this.app.modal.show({title: 'Please wait...', body: 'progress', closing_events: true, buttons: {
|
||||
this.app.modal.show({title: 'Please wait...', body: 'progress', buttons: {
|
||||
'Close' : function () {
|
||||
self.app.modal.hide();
|
||||
user_is_waiting = false;
|
||||
|
||||
@@ -1 +1 @@
|
||||
define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(c){this.app=c},submit:function(){var c=this;var e={tool_id:this.app.options.id,tool_version:this.app.options.version,inputs:this.app.tree.finalize()};this.app.trigger("reset");if(!this._validation(e)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(e);var d=true;this.app.modal.show({title:"Please wait...",body:"progress",closing_events:true,buttons:{Close:function(){c.app.modal.hide();d=false}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:e,success:function(f){c.app.modal.hide();c.app.reciept(a.success(f));c._refreshHdas()},error:function(f,h){c.app.modal.hide();if(f&&f.message&&f.message.data){var i=c.app.tree.matchResponse(f.message.data);for(var g in i){c.app.highlight(g,i[g]);break}}else{console.debug(f);d&&c.app.modal.show({title:"Job submission failed",body:a.error(e),buttons:{Close:function(){c.app.modal.hide()}}})}}})},_validation:function(h){var d=h.inputs;var m=-1;var i=null;for(var k in d){var f=d[k];var l=this.app.tree.match(k);var e=this.app.field_list[l];var j=this.app.input_list[l];if(!l||!j||!e){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!j.optional&&f==null){this.app.highlight(l);return false}if(f&&f.batch){var g=f.values.length;var c=null;if(g>0){c=f.values[0]&&f.values[0].src}if(c){if(i===null){i=c}else{if(i!==c){this.app.highlight(l,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(m===-1){m=g}else{if(m!==g){this.app.highlight(l,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+m+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
|
||||
define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(c){this.app=c},submit:function(){var c=this;var e={tool_id:this.app.options.id,tool_version:this.app.options.version,inputs:this.app.tree.finalize()};this.app.trigger("reset");if(!this._validation(e)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.debug(e);var d=true;this.app.modal.show({title:"Please wait...",body:"progress",buttons:{Close:function(){c.app.modal.hide();d=false}}});b.request({type:"POST",url:galaxy_config.root+"api/tools",data:e,success:function(f){c.app.modal.hide();c.app.reciept(a.success(f));c._refreshHdas()},error:function(f,h){c.app.modal.hide();if(f&&f.message&&f.message.data){var i=c.app.tree.matchResponse(f.message.data);for(var g in i){c.app.highlight(g,i[g]);break}}else{console.debug(f);d&&c.app.modal.show({title:"Job submission failed",body:a.error(e),buttons:{Close:function(){c.app.modal.hide()}}})}}})},_validation:function(h){var d=h.inputs;var m=-1;var i=null;for(var k in d){var f=d[k];var l=this.app.tree.match(k);var e=this.app.field_list[l];var j=this.app.input_list[l];if(!l||!j||!e){console.debug("tools-jobs::_validation - Retrieving input objects failed.");continue}if(!j.optional&&f==null){this.app.highlight(l);return false}if(f&&f.batch){var g=f.values.length;var c=null;if(g>0){c=f.values[0]&&f.values[0].src}if(c){if(i===null){i=c}else{if(i!==c){this.app.highlight(l,"Please select either dataset or dataset list fields for all batch mode fields.");return false}}}if(m===-1){m=g}else{if(m!==g){this.app.highlight(l,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+m+"</b>.");return false}}}}return true},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
|
||||
Reference in New Issue
Block a user