From 59f8fd906e2404c6aa2434818501f860973c7928 Mon Sep 17 00:00:00 2001 From: Felipe Bormann Date: Fri, 2 Jun 2017 15:40:37 -0300 Subject: [PATCH] fixed multiple tables of most accessed, I hope so --- dashboards/static/dashboards/js/behavior.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dashboards/static/dashboards/js/behavior.js b/dashboards/static/dashboards/js/behavior.js index 393939c..9399225 100644 --- a/dashboards/static/dashboards/js/behavior.js +++ b/dashboards/static/dashboards/js/behavior.js @@ -71,7 +71,7 @@ var selectors_options = { loadData: function(e){ if (e){ opened = $(e).attr('opened'); - if (typeof opened !== typeof undefined){ + if (opened == "true"){ selectors_options.deleteChildren(e); }else { switch(e.attributes['data-url'].value){ @@ -113,15 +113,16 @@ var selectors_options = { $(e).after(string_build); var new_elem = $(e).next(); + $(new_elem).addClass($(e).attr("data-url")); new_elem.slideDown({easing: 'easeInOutSine'}, 5000); - $(e).attr("opened"); + $(e).attr("opened", true); }, deleteChildren: function(e){ - var most_accessed_list = $(e).next(); + var most_accessed_list = $(e).siblings("." + $(e).attr("data-url")); $(most_accessed_list).slideUp({easing: 'easeInOutSine'}, 1200); $(most_accessed_list).remove(); - $(e).removeAttr("opened"); //remove attribute so it can call API again + $(e).attr("opened", false); //remove attribute so it can call API again }, }; -- libgit2 0.21.2