mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 11:37:47 +01:00
fix manual deletion not decreasing ib-count
This commit is contained in:
parent
d880681f37
commit
a122106d82
1 changed files with 10 additions and 1 deletions
|
@ -9,7 +9,10 @@
|
|||
if data.success
|
||||
($ "div#entries").prepend(data.render) # TODO: slideDown or something
|
||||
# GitHub issue #26:
|
||||
del_all_btn = ($ "button#ib-delete-all")
|
||||
if document.getElementById('ib-delete-all') == undefined
|
||||
del_all_btn = ($ "button#ib-delete-all-author")
|
||||
else
|
||||
del_all_btn = ($ "button#ib-delete-all")
|
||||
del_all_btn.removeAttr 'disabled'
|
||||
del_all_btn[0].dataset.ibCount = (Number del_all_btn[0].dataset.ibCount) + 1
|
||||
error: (jqxhr, status, error) ->
|
||||
|
@ -160,6 +163,12 @@ $(document).on "click", "button[name=ib-destroy]", ->
|
|||
success: (data, status, jqxhr) ->
|
||||
if data.success
|
||||
$("div.inbox-box[data-id=#{iid}]").slideUp()
|
||||
if document.getElementById('ib-delete-all') == undefined
|
||||
del_all_btn = ($ "button#ib-delete-all-author")
|
||||
else
|
||||
del_all_btn = ($ "button#ib-delete-all")
|
||||
del_all_btn.removeAttr 'disabled'
|
||||
del_all_btn[0].dataset.ibCount = (Number del_all_btn[0].dataset.ibCount) - 1
|
||||
showNotification data.message, data.success
|
||||
error: (jqxhr, status, error) ->
|
||||
console.log jqxhr, status, error
|
||||
|
|
Loading…
Reference in a new issue