Commit a68f1fdd authored by Phil Hughes's avatar Phil Hughes

Fix form not re-enabling thanks to jQuery

Stop issue being dragged if it doesn't have an ID
parent b9ede4f1
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
group: 'issues', group: 'issues',
sort: false, sort: false,
disabled: this.disabled, disabled: this.disabled,
filter: '.board-list-count, .board-new-issue-form', filter: '.board-list-count, .is-disabled',
onStart: (e) => { onStart: (e) => {
const card = this.$refs.issue[e.oldIndex]; const card = this.$refs.issue[e.oldIndex];
......
...@@ -25,7 +25,11 @@ ...@@ -25,7 +25,11 @@
labels 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(); this.cancel();
}, },
......
...@@ -91,7 +91,7 @@ class List { ...@@ -91,7 +91,7 @@ class List {
this.addIssue(issue); this.addIssue(issue);
this.issuesSize++; this.issuesSize++;
gl.boardService.newIssue(this.id, issue) return gl.boardService.newIssue(this.id, issue)
.then((resp) => { .then((resp) => {
const data = resp.json(); const data = resp.json();
issue.id = data.iid; issue.id = data.iid;
......
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
":id" => "list.id + '-title'" } ":id" => "list.id + '-title'" }
.clearfix.prepend-top-10 .clearfix.prepend-top-10
%button.btn.btn-success.pull-left{ type: "submit", %button.btn.btn-success.pull-left{ type: "submit",
":disabled" => "title === ''" } ":disabled" => "title === ''",
"v-el:submit-button" => true }
Submit issue Submit issue
%button.btn.btn-default.pull-right{ type: "button", %button.btn.btn-default.pull-right{ type: "button",
"@click" => "cancel" } "@click" => "cancel" }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
":issue-link-base" => "issueLinkBase", ":issue-link-base" => "issueLinkBase",
":disabled" => "disabled", ":disabled" => "disabled",
"track-by" => "id" } "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" } ":index" => "index" }
%h4.card-title %h4.card-title
= icon("eye-slash", class: "confidential-icon", "v-if" => "issue.confidential") = icon("eye-slash", class: "confidential-icon", "v-if" => "issue.confidential")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment