added a count
This commit is contained in:
parent
aa9bd028db
commit
2169a86615
|
@ -16,8 +16,9 @@
|
|||
|
||||
|
||||
($ document).on "click", "button#ib-delete-all", ->
|
||||
if confirm 'Are you sure?'
|
||||
btn = ($ this)
|
||||
btn = ($ this)
|
||||
count = btn[0].dataset.ibCount
|
||||
if confirm "Really delete #{count} questions?"
|
||||
btn.button "loading"
|
||||
succ = no
|
||||
$.ajax
|
||||
|
@ -38,6 +39,7 @@
|
|||
btn.button "reset"
|
||||
if succ
|
||||
btn.attr "disabled", "disabled" # this doesn't really work like I wanted it to…
|
||||
btn[0].dataset.ibCount = 0
|
||||
|
||||
|
||||
$(document).on "keydown", "textarea[name=ib-answer]", (evt) ->
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
.panel-heading
|
||||
%h3.panel-title Actions
|
||||
.panel-body
|
||||
%button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil)} Delete all questions
|
||||
%button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions
|
||||
.col-md-9.col-xs-12.col-sm-9
|
||||
= render 'layouts/messages'
|
||||
#entries
|
||||
|
|
Loading…
Reference in New Issue