Commit c3c84992 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Unbind note events to prevent firing twice with turbolinks

parent c78393ec
var NoteList = { var NoteList = {
id: null,
notes_path: null, notes_path: null,
target_params: null, target_params: null,
target_id: 0, target_id: 0,
...@@ -16,6 +16,16 @@ var NoteList = { ...@@ -16,6 +16,16 @@ var NoteList = {
// get initial set of notes // get initial set of notes
NoteList.getContent(); NoteList.getContent();
// Unbind events to prevent firing twice
$(document).off("click", ".js-add-diff-note-button");
$(document).off("click", ".js-discussion-reply-button");
$(document).off("click", ".js-note-preview-button");
$(document).off("click", ".js-note-attachment-input");
$(document).off("click", ".js-close-discussion-note-form");
$(document).off("click", ".js-note-delete");
$(document).off("ajax:complete", ".js-main-target-form");
// add a new diff note // add a new diff note
$(document).on("click", $(document).on("click",
".js-add-diff-note-button", ".js-add-diff-note-button",
......
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