Skip to content

Commit

Permalink
Merge pull request webcompat#1435 from laghee/issues/1199/2
Browse files Browse the repository at this point in the history
Fixes webcompat#1199 - Simple bugform.js cleanup
  • Loading branch information
Mike Taylor authored Mar 27, 2017
2 parents d660424 + dbd3665 commit 669123e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ function BugForm() {
this.submitButtons = $("#js-ReportForm .js-Button");
this.loadingIndicator = $(".js-Loader");
this.reportButton = $("#js-ReportBug");
this.loaderImage = $(".js-Loader");
this.uploadLoader = $(".js-Upload-Loader");
// by default, submission type is anonymous
this.submitType = "github-proxy-report";
this.UPLOAD_LIMIT = 1024 * 1024 * 4;

this.inputs = {
Expand Down Expand Up @@ -60,14 +58,7 @@ function BugForm() {
this.uploadField.on("change", _.bind(this.checkImageTypeValidity, this));
this.osField.add(this.browserField)
.on("blur input", _.bind(this.checkOptionalNonEmpty, this));
this.submitButtons.on("click", _.bind(function(e) {
if (e.target && e.target.value) {
// store a reference to what report button was clicked
this.submitType = e.target.value;
}

this.loadingIndicator.show();
}, this));
this.submitButtons.on("click", _.bind(this.loadingIndicator.show, this));

// See if the user already has a valid form
// (after a page refresh, back button, etc.)
Expand Down Expand Up @@ -434,7 +425,7 @@ function BugForm() {
msg = "The image is too big! Please choose something smaller than 4MB.";
wcEvents.trigger("flash:error", {message: msg, timeout: 5000});
}
this.loaderImage.hide();
this.loadingIndicator.hide();
}, this)
});

Expand Down

0 comments on commit 669123e

Please sign in to comment.