From d5fcec4d7d1c67230072e65670d20dd8d7d1524a Mon Sep 17 00:00:00 2001 From: Georg G Date: Thu, 12 Feb 2015 22:15:01 +0100 Subject: [PATCH] hide that "Load more" button if you delete all questions --- app/assets/javascripts/inbox.coffee | 1 + app/views/inbox/_sidebar.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/inbox.coffee b/app/assets/javascripts/inbox.coffee index ff553e0b..0741ce09 100644 --- a/app/assets/javascripts/inbox.coffee +++ b/app/assets/javascripts/inbox.coffee @@ -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.") diff --git a/app/views/inbox/_sidebar.html.haml b/app/views/inbox/_sidebar.html.haml index c9629caf..dedb5906 100644 --- a/app/views/inbox/_sidebar.html.haml +++ b/app/views/inbox/_sidebar.html.haml @@ -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 \ No newline at end of file + %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 \ No newline at end of file