Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tool form to listen to history #2476

Merged
merged 5 commits into from Jul 26, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

made changes to tool-form-base.js, this should allow the tool-form to…

… listen to history. Thanks @guerler for walking me through backbone
  • Loading branch information...
nturaga committed Apr 22, 2016
commit 26b141c83f906dbc7d11c14da968f323eaa632e8
@@ -11,11 +11,26 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
this.deferred = new Deferred();
if (options.inputs) {
this._buildForm(options);
options.needs_update && this.refresh();
} else {
this.deferred.execute(function(process) {
self._buildModel(process, options, true);
});
}
// Listen to history panel
if ( options.listen_to_history && parent.Galaxy && parent.Galaxy.currHistoryPanel ) {
this.listenTo( parent.Galaxy.currHistoryPanel.collection, 'change', function() {
this.refresh();
});
}
},

/** Listen to history panel changes and update the tool form */
refresh: function() {
var self = this;
this.deferred.execute( function (process){
self._updateModel( process)
});
},

/** Wait for deferred build processes before removal */
@@ -315,4 +330,4 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
return 'No requirements found.';
}
});
});
});
@@ -6,6 +6,7 @@ define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base' ],
var View = ToolFormBase.extend({
initialize: function( options ) {
var self = this;
options.listen_to_history = true;
ToolFormBase.prototype.initialize.call( this, Utils.merge({
customize: function( options ) {
// build execute button

Some generated files are not rendered by default. Learn more.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.