Adds feature: Ajax Close/Open updates discussion automatically

Triggers jQuery event
Fixes #5544
This commit is contained in:
Jacob Schatz 2016-01-26 00:25:41 -05:00
parent fd33b2cdc0
commit 55e031a0d0
2 changed files with 3 additions and 0 deletions

View file

@ -50,6 +50,7 @@ class @Issue
new Flash(issueFailMessage, 'alert')
success: (data, textStatus, jqXHR) ->
if data.saved
$(document).trigger('issuable:change');
if isClose
$('a.btn-close').addClass('hidden')
$('a.btn-reopen').removeClass('hidden')

View file

@ -64,6 +64,8 @@ class @Notes
# fetch notes when tab becomes visible
$(document).on "visibilitychange", @visibilityChange
$(document).on "issuable:change", @refresh
cleanBinding: ->
$(document).off "ajax:success", ".js-main-target-form"
$(document).off "ajax:success", ".js-discussion-note-form"