提交 77f6f0b8 编写于 作者: F Fatih Acet

IssueNotesRefactor: Listen main issue action and update note form buttons.

上级 4e86445b
......@@ -66,12 +66,11 @@ class Issue {
const projectIssuesCounter = $('.issue_counter');
if ('id' in data) {
$(document).trigger('issuable:change');
const isClosed = $button.hasClass('btn-close');
isClosedBadge.toggleClass('hidden', !isClosed);
isOpenBadge.toggleClass('hidden', isClosed);
$(document).trigger('issuable:change', isClosed);
this.toggleCloseReopenButton(isClosed);
let numProjectIssues = Number(projectIssuesCounter.text().replace(/[^\d]/, ''));
......
......@@ -122,6 +122,10 @@ export default {
this.markdownDocsUrl = markdownDocs;
this.markdownPreviewUrl = markdownPreviewUrl;
eventHub.$on('IssueStateChanged', (isClosed) => {
this.issueState = isClosed ? 'closed' : 'reopened';
});
},
};
</script>
......
......@@ -88,6 +88,10 @@ export default {
new Flash('Something went wrong on our end.'); // eslint-disable-line
});
});
$(document).on('issuable:change', (e, isClosed) => {
eventHub.$emit('IssueStateChanged', isClosed);
});
},
checkLocationHash() {
const hash = gl.utils.getLocationHash();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册