Skip to content
Permalink
Browse files

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
1 parent 581e5cc commit d7a9fa13b282b5b4e8f2ba8e39f958bb35c69024
@@ -11,14 +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.deferred.execute( function( process ) {
self._updateModel( process );
});
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 */
@@ -6,6 +6,7 @@ define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/tool/tool-form-base', 'mvc/tool/to
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit d7a9fa1

Please sign in to comment.
You can’t perform that action at this time.