Merge pull request #1888 from C-Otto/tracks-1882

navigate back to note's project after deletion
This commit is contained in:
Matt Rogers 2015-08-07 21:05:21 -04:00
commit 486204c1d7
2 changed files with 10 additions and 2 deletions

View file

@ -56,6 +56,7 @@ class NotesController < ApplicationController
def destroy
@note = current_user.notes.find(params['id'])
@note.destroy
set_source_view
respond_to do |format|
format.html

View file

@ -1,6 +1,13 @@
remove_deleted_note(<%=@note.id%>);
TracksPages.set_page_badge(<%=@down_count%>);
TracksPages.page_inform("<%= t('notes.deleted_note', :id => @note.id)%>");
<%
if @source_view == 'note' %>
redirect_to("<%= project_path(@note.project) -%>")
<% else %>
remove_deleted_note(<%=@note.id%>);
TracksPages.set_page_badge(<%=@down_count%>);
<%
end
%>
function remove_deleted_note(id) {
TracksPages.slide_up_and_remove('div#note-'+id+'-wrapper');