Commit 596e64e5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Drop rjs from Notes#index

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 071de30f
......@@ -6,7 +6,7 @@ var NoteList = {
target_type: null,
init: function(tid, tt, path) {
NoteList.notes_path = path + ".js";
NoteList.notes_path = path + ".json";
NoteList.target_id = tid;
NoteList.target_type = tt;
NoteList.target_params = "target_type=" + NoteList.target_type + "&target_id=" + NoteList.target_id;
......@@ -411,7 +411,10 @@ var NoteList = {
data: NoteList.target_params,
complete: function(){ $('.js-notes-busy').removeClass("loading")},
beforeSend: function() { $('.js-notes-busy').addClass("loading") },
dataType: "script"
success: function(data) {
NoteList.setContent(data.html);
},
dataType: "json"
});
},
......@@ -419,7 +422,7 @@ var NoteList = {
* Called in response to getContent().
* Replaces the content of #notes-list with the given html.
*/
setContent: function(newNoteIds, html) {
setContent: function(html) {
$("#notes-list").html(html);
},
......
......@@ -14,7 +14,20 @@ class Projects::NotesController < Projects::ApplicationController
@discussions = discussions_from_notes
end
respond_with(@notes)
respond_to do |format|
format.html { redirect_to :back }
format.json do
html = render_to_string(
"projects/notes/_notes",
layout: false,
formats: [:html]
)
render json: {
html: html,
}
end
end
end
def create
......
- unless @notes.blank?
var notesHtml = "#{escape_javascript(render 'projects/notes/notes')}";
- new_note_ids = @notes.map(&:id)
NoteList.setContent(#{new_note_ids}, notesHtml);
......@@ -30,7 +30,7 @@ class Settings < Settingslogic
gitlab.relative_url_root
].join('')
end
# check that values in `current` (string or integer) is a contant in `modul`.
def verify_constant_array(modul, current, default)
values = default || []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment