Skip to content

Commit

Permalink
Add reset and close buttons for upload widget when selecting rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Apr 3, 2018
1 parent 8b78c84 commit f473cbc
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion client/galaxy/scripts/mvc/upload/collection/rules-input-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ export default Backbone.View.extend({
this._eventBuild();
}
});
_.each([this.btnBuild], button => {
this.btnBuild.$el.addClass("btn-primary");
this.btnReset = new Ui.Button({
id: "btn-reset",
title: _l("Reset"),
onclick: () => this._eventReset(),
});
this.btnClose = new Ui.Button({
id: "btn-close",
title: _l("Close"),
onclick: () => this.app.modal.hide(),
});
_.each([this.btnReset, this.btnBuild, this.btnClose], button => {
this.$(".upload-buttons").prepend(button.$el);
});
const dataTypeOptions = [{ id: "datasets", text: "Datasets" }, { id: "collections", text: "Collection(s)" }];
Expand Down Expand Up @@ -106,6 +117,15 @@ export default Backbone.View.extend({
.catch(error => console.log(error));
},

/** Remove all */
_eventReset: function() {
if (this.datasetSelectorView) {
this.datasetSelectorView.value(null);
}
$(".upload-rule-source-content").val('');
this._updateScreen();
},

_eventBuild: function() {
const selection = this.$(".upload-rule-source-content").val();
this._buildSelection(selection);
Expand Down

0 comments on commit f473cbc

Please sign in to comment.