Fix form not re-enabling thanks to jQuery

Stop issue being dragged if it doesn't have an ID
This commit is contained in:
Phil Hughes 2016-10-05 14:27:29 +01:00
parent b9ede4f1a5
commit a68f1fdd29
5 changed files with 10 additions and 5 deletions

View file

@ -76,7 +76,7 @@
group: 'issues',
sort: false,
disabled: this.disabled,
filter: '.board-list-count, .board-new-issue-form',
filter: '.board-list-count, .is-disabled',
onStart: (e) => {
const card = this.$refs.issue[e.oldIndex];

View file

@ -25,7 +25,11 @@
labels
});
this.list.newIssue(issue);
this.list.newIssue(issue)
.then(() => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions
$(this.$els.submitButton).enable();
});
this.cancel();
},

View file

@ -91,7 +91,7 @@ class List {
this.addIssue(issue);
this.issuesSize++;
gl.boardService.newIssue(this.id, issue)
return gl.boardService.newIssue(this.id, issue)
.then((resp) => {
const data = resp.json();
issue.id = data.iid;

View file

@ -54,7 +54,8 @@
":id" => "list.id + '-title'" }
.clearfix.prepend-top-10
%button.btn.btn-success.pull-left{ type: "submit",
":disabled" => "title === ''" }
":disabled" => "title === ''",
"v-el:submit-button" => true }
Submit issue
%button.btn.btn-default.pull-right{ type: "button",
"@click" => "cancel" }

View file

@ -7,7 +7,7 @@
":issue-link-base" => "issueLinkBase",
":disabled" => "disabled",
"track-by" => "id" }
%li.card{ ":class" => "{ 'user-can-drag': !disabled }",
%li.card{ ":class" => "{ 'user-can-drag': !disabled && issue.id, 'is-disabled': disabled || !issue.id }",
":index" => "index" }
%h4.card-title
= icon("eye-slash", class: "confidential-icon", "v-if" => "issue.confidential")