Clean up dead code
This commit is contained in:
+2
-13
@@ -225,7 +225,6 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
this.listen(this, 'click', '_submitOnTap');
|
||||
this.listen(this._form, 'submit', '_onFormSubmit');
|
||||
this.listen(this._form, 'invalid', '_onFormFailed');
|
||||
this.listen(this._form, 'response', '_onFormSuccess');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,7 +343,7 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
}
|
||||
|
||||
_submitOnTap() {
|
||||
if (this.submit && !this.isSubmitting) {
|
||||
if (this.submit && !this.locked) {
|
||||
this._form.submitButton = this;
|
||||
this._form.submit();
|
||||
}
|
||||
@@ -356,14 +355,6 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
}
|
||||
}
|
||||
|
||||
_onFormSuccess() {
|
||||
this.isSubmitting(false);
|
||||
|
||||
if (this.reactive) {
|
||||
this.showSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
_onFormFailed(e) {
|
||||
// Only react if this button instance was the actual pressed button.
|
||||
// We have to check this in case the parent form has multiple submit buttons.
|
||||
@@ -374,10 +365,8 @@ class TpButton extends EventHelpers(LitElement) {
|
||||
}
|
||||
}
|
||||
|
||||
this.isSubmitting = false;
|
||||
|
||||
if (this.reactive) {
|
||||
this.showError();
|
||||
this.hideSpinner();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user