From b7ccfccfe08a77fec08fa691c27fa7a53e54863c Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 19 Nov 2018 11:48:53 +0100 Subject: [PATCH] Imrove tags update behaviour on canvas [SCI-2830] --- app/assets/javascripts/projects/canvas.js.erb | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/projects/canvas.js.erb b/app/assets/javascripts/projects/canvas.js.erb index ca2463470..fdf2047d2 100644 --- a/app/assets/javascripts/projects/canvas.js.erb +++ b/app/assets/javascripts/projects/canvas.js.erb @@ -873,23 +873,21 @@ function bindEditTagsAjax(elements) { // Reload tags HTML element when modal is closed manageTagsModal.on("hide.bs.modal", function(){ - var tasks = $("div.panel"); + var task = $("div.panel[data-module-id='" + + manageTagsModal.data('module-id') + "']"); - tasks.each(function(){ - var task = $(this); - // Load HTML - $.ajax({ - url: task.attr("data-module-tags-url"), - type: "GET", - dataType: "json", - success: function(data){ - task.find(".edit-tags-link") - .html(data.html_canvas); - }, - error: function(data){ - // TODO - } - }) + // Load HTML + $.ajax({ + url: task.attr("data-module-tags-url"), + type: "GET", + dataType: "json", + success: function(data){ + task.find(".edit-tags-link") + .html(data.html_canvas); + }, + error: function(data){ + // TODO + } }); });