This commit is contained in:
Yuki 2015-04-27 06:51:29 +05:30
parent db474773bd
commit 76ac8e1a9d
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ $(document).on "click", "a[data-action=ab-question-destroy]", (ev) ->
success: (data, status, jqxhr) ->
if data.success
if btn[0].dataset.redirect != undefined
window.location.href = btn[0].dataset.redirect
window.location.pathname = btn[0].dataset.redirect
else
$("div.answerbox[data-q-id=#{qid}], div.questionbox[data-id=#{qid}]").slideUp()
showNotification data.message, data.success

View File

@ -13,7 +13,7 @@
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
- if current_user.mod? or @question.user == current_user
%li.text-danger
%a{href: '#', data: { action: 'ab-question-destroy', q_id: @question.id, redirect: '/' }}
%a{href: '#', data: { action: 'ab-question-destroy', q_id: @question.id, redirect: if @question.author_is_anonymous? then "/" else show_user_questions_path(@question.user.screen_name) end }}
%i.fa.fa-trash-o
Delete Question
- unless @question.user == current_user