Commit 59f8fd906e2404c6aa2434818501f860973c7928
1 parent
ad0843b8
Exists in
master
and in
2 other branches
fixed multiple tables of most accessed, I hope so
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
dashboards/static/dashboards/js/behavior.js
@@ -71,7 +71,7 @@ var selectors_options = { | @@ -71,7 +71,7 @@ var selectors_options = { | ||
71 | loadData: function(e){ | 71 | loadData: function(e){ |
72 | if (e){ | 72 | if (e){ |
73 | opened = $(e).attr('opened'); | 73 | opened = $(e).attr('opened'); |
74 | - if (typeof opened !== typeof undefined){ | 74 | + if (opened == "true"){ |
75 | selectors_options.deleteChildren(e); | 75 | selectors_options.deleteChildren(e); |
76 | }else { | 76 | }else { |
77 | switch(e.attributes['data-url'].value){ | 77 | switch(e.attributes['data-url'].value){ |
@@ -113,15 +113,16 @@ var selectors_options = { | @@ -113,15 +113,16 @@ var selectors_options = { | ||
113 | 113 | ||
114 | $(e).after(string_build); | 114 | $(e).after(string_build); |
115 | var new_elem = $(e).next(); | 115 | var new_elem = $(e).next(); |
116 | + $(new_elem).addClass($(e).attr("data-url")); | ||
116 | new_elem.slideDown({easing: 'easeInOutSine'}, 5000); | 117 | new_elem.slideDown({easing: 'easeInOutSine'}, 5000); |
117 | - $(e).attr("opened"); | 118 | + $(e).attr("opened", true); |
118 | 119 | ||
119 | }, | 120 | }, |
120 | deleteChildren: function(e){ | 121 | deleteChildren: function(e){ |
121 | - var most_accessed_list = $(e).next(); | 122 | + var most_accessed_list = $(e).siblings("." + $(e).attr("data-url")); |
122 | $(most_accessed_list).slideUp({easing: 'easeInOutSine'}, 1200); | 123 | $(most_accessed_list).slideUp({easing: 'easeInOutSine'}, 1200); |
123 | $(most_accessed_list).remove(); | 124 | $(most_accessed_list).remove(); |
124 | - $(e).removeAttr("opened"); //remove attribute so it can call API again | 125 | + $(e).attr("opened", false); //remove attribute so it can call API again |
125 | }, | 126 | }, |
126 | }; | 127 | }; |
127 | 128 |