Disabling the "project" column in a ToasterTable for builds causes the recent builds area to be hidden. This is because the column hiding code hides all elements with a class matching ".<column>", regardless of where they occur on the page; and the recent builds area was using the ".project-name" class, which means it is included in the set of elements which are hidden.
Scope the element search to the table so that only elements within the table are hidden or shown. [YOCTO #8792] Signed-off-by: Elliot Smith <[email protected]> --- bitbake/lib/toaster/toastergui/static/js/table.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index d77ebaf..5ffb319 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -313,7 +313,7 @@ function tableInit(ctx){ $("#"+ctx.tableName+" th").each(function(){ for (var i in cols_hidden){ if ($(this).hasClass(cols_hidden[i])){ - $("."+cols_hidden[i]).hide(); + table.find("."+cols_hidden[i]).hide(); $("#checkbox-"+cols_hidden[i]).removeAttr("checked"); } } @@ -323,7 +323,7 @@ function tableInit(ctx){ * user setting. */ for (var i in defaultHiddenCols) { - $("."+defaultHiddenCols[i]).hide(); + table.find("."+defaultHiddenCols[i]).hide(); $("#checkbox-"+defaultHiddenCols[i]).removeAttr("checked"); } } @@ -367,9 +367,9 @@ function tableInit(ctx){ var disabled_cols = []; if ($(this).prop("checked")) { - $("."+col).show(); + table.find("."+col).show(); } else { - $("."+col).hide(); + table.find("."+col).hide(); /* If we're ordered by the column we're hiding remove the order by */ if (col === tableParams.orderby || '-' + col === tableParams.orderby){ -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
