hide that "Load more" button if you delete all questions

This commit is contained in:
Georg G 2015-02-12 22:15:01 +01:00
parent 66c5e46a78
commit d5fcec4d7d
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@
success: (data, status, jqxhr) ->
if data.success
succ = yes
($ "div#pagination, button#load-more-btn").slideUp()
entries = ($ "div#entries")
entries.slideUp 400, ->
entries.html("Nothing to see here.")

View File

@ -17,4 +17,4 @@
.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), data: { ib_count: @inbox.count }} Delete all questions
%button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (Inbox.where(user: current_user).empty? ? 'disabled' : nil), data: { ib_count: Inbox.where(user: current_user).count }} Delete all questions