mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Use routing helper to navigate to tool form
This commit is contained in:
@@ -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 } );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user