Skip to content

Commit

Permalink
Add listener to properly clean up deferred form building processes
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Sep 23, 2016
1 parent 7a73681 commit 42ebe00
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 20 deletions.
4 changes: 3 additions & 1 deletion client/galaxy/scripts/mvc/tool/tool-form-base.js
Expand Up @@ -16,12 +16,14 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
self._buildModel(process, options, true);
});
}
// Listen to history panel
// listen to history panel
if ( options.listen_to_history && parent.Galaxy && parent.Galaxy.currHistoryPanel ) {
this.listenTo( parent.Galaxy.currHistoryPanel.collection, 'change', function() {
this.refresh();
});
}
// destroy dom elements
this.$el.on( 'remove', function() { self.remove() } );
},

/** Listen to history panel changes and update the tool form */
Expand Down
4 changes: 0 additions & 4 deletions client/galaxy/scripts/mvc/tool/tool-form.js
Expand Up @@ -47,10 +47,6 @@ define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-modal', 'mvc/tool/tool-form
this.$el.append( this.form.$el );
},

remove: function() {
this.form.remove();
},

/** Submit a regular job.
* @param{dict} options - Specifies tool id and version
* @param{function} callback - Called when request has completed
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/tool/tool-form-base.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 42ebe00

Please sign in to comment.