ajax notes load

This commit is contained in:
gitlabhq 2011-10-17 19:48:10 +03:00
parent 8a8e77d54f
commit 74a89d9ed6
4 changed files with 17 additions and 4 deletions

View file

@ -0,0 +1,2 @@
:plain
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");

View file

@ -1,7 +1,4 @@
%ul#notes-list %ul#notes-list= render "notes/notes_list"
- @notes.each do |note|
- next unless note.author
= render :partial => "notes/show", :locals => {:note => note}
%br %br
%br %br
@ -12,4 +9,12 @@
$('.delete-note').live('ajax:success', function() { $('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); }); $(this).closest('li').fadeOut(); });
- if ["issues", "projects"].include?(controller.controller_name)
:javascript
$(function(){
var int =self.setInterval("updatePage()", 20000);
});
function updatePage(){
$.ajax({type: "GET", url: location.href, dataType: "script"});
}

View file

@ -0,0 +1,4 @@
- @notes.each do |note|
- next unless note.author
= render :partial => "notes/show", :locals => {:note => note}

View file

@ -0,0 +1,2 @@
:plain
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");