ajax notes load
This commit is contained in:
parent
8a8e77d54f
commit
74a89d9ed6
2
app/views/issues/show.js.haml
Normal file
2
app/views/issues/show.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
:plain
|
||||||
|
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
|
@ -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"});
|
||||||
|
}
|
||||||
|
|
4
app/views/notes/_notes_list.html.haml
Normal file
4
app/views/notes/_notes_list.html.haml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- @notes.each do |note|
|
||||||
|
- next unless note.author
|
||||||
|
= render :partial => "notes/show", :locals => {:note => note}
|
||||||
|
|
2
app/views/projects/wall.js.haml
Normal file
2
app/views/projects/wall.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
:plain
|
||||||
|
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
Loading…
Reference in a new issue