This commit is contained in:
parent
db474773bd
commit
76ac8e1a9d
|
@ -20,7 +20,7 @@ $(document).on "click", "a[data-action=ab-question-destroy]", (ev) ->
|
||||||
success: (data, status, jqxhr) ->
|
success: (data, status, jqxhr) ->
|
||||||
if data.success
|
if data.success
|
||||||
if btn[0].dataset.redirect != undefined
|
if btn[0].dataset.redirect != undefined
|
||||||
window.location.href = btn[0].dataset.redirect
|
window.location.pathname = btn[0].dataset.redirect
|
||||||
else
|
else
|
||||||
$("div.answerbox[data-q-id=#{qid}], div.questionbox[data-id=#{qid}]").slideUp()
|
$("div.answerbox[data-q-id=#{qid}], div.questionbox[data-id=#{qid}]").slideUp()
|
||||||
showNotification data.message, data.success
|
showNotification data.message, data.success
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
|
%ul.dropdown-menu.dropdown-menu-right{role: :menu}
|
||||||
- if current_user.mod? or @question.user == current_user
|
- if current_user.mod? or @question.user == current_user
|
||||||
%li.text-danger
|
%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
|
%i.fa.fa-trash-o
|
||||||
Delete Question
|
Delete Question
|
||||||
- unless @question.user == current_user
|
- unless @question.user == current_user
|
||||||
|
|
Loading…
Reference in New Issue