Use routing helper to navigate to tool form

This commit is contained in:
guerler
2017-03-09 13:44:15 -05:00
parent 0fb9fbc388
commit 6e32b0f7c1
10 changed files with 25 additions and 35 deletions
+9 -9
View File
@@ -68,15 +68,6 @@ window.app = function app( options, bootstrapped ){
Galaxy.currHistoryPanel = historyPanel.historyView;
Galaxy.currHistoryPanel.listenToGalaxy( Galaxy );
//HACK: move there
Galaxy.app = {
display : function( view, target ){
// TODO: Remove this line after select2 update
$( '.select2-hidden-accessible' ).remove();
centerPanel.display( view );
},
};
// .................................................... routes
/** */
Galaxy.router = new ( Backbone.Router.extend({
@@ -86,6 +77,15 @@ window.app = function app( options, bootstrapped ){
this.options = options;
},
/** helper to push a new navigation state */
push: function( url, data ) {
if ( !$.isEmptyObject( data ) ) {
url += url.indexOf( '?' ) == -1 ? '?' : '&';
url += $.param( data , true );
}
this.navigate( url, { 'trigger': true } );
},
/** override to parse query string into obj and send to each route */
execute: function( callback, args, name ){
Galaxy.debug( 'router execute:', callback, args, name );
@@ -218,14 +218,7 @@ var DatasetListItemEdit = _super.extend(
faIcon : 'fa-refresh',
onclick : function( ev ) {
ev.preventDefault();
// create webpack split point in order to load the tool form async
// TODO: split not working (tool loads fine)
require([ 'mvc/tool/tool-form' ], function( ToolForm ){
var form = new ToolForm.View({ 'job_id' : creating_job });
form.deferred.execute( function(){
Galaxy.app.display( form );
});
});
Galaxy.router.push( '/', { job_id : creating_job } );
}
});
}
+1 -4
View File
@@ -532,10 +532,7 @@ var ToolLinkView = BaseView.extend({
var self = this;
$link.find('a').on('click', function(e) {
e.preventDefault();
var form = new ToolForm.View( { id : self.model.id, version : self.model.get('version') } );
form.deferred.execute(function() {
Galaxy.app.display( form );
});
Galaxy.router.push( '/', { tool_id : self.model.id, version : self.model.get('version') } );
});
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long