toaster: tablejs Make sure click handlers consume click event
PATCH 1/1 toaster: tablejs Make sure click handlers consume click event
From: Michael Wood <[email protected]>
Avoid the click event from propagating and causing strange side effects in toaster tables.
[YOCTO #8527]
[YOCTO #8148]
Signed-off-by Michael Wood <[email protected]>
Signed-off-by Elliot Smith <[email protected]>
--- bitbake/lib/toaster/toastergui/static/js/table.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
bitbake/lib/toaster/toastergui/static/js/table.js +6 -4
@@ -340,7 +340,8 @@ function tableInit(ctx){ } } - function sortColumnClicked(){ + function sortColumnClicked(e){ + e.preventDefault(); /* We only have one sort at a time so remove any existing sort indicators */ $("#"+ctx.tableName+" th .icon-caret-down").hide();
@@ -476,6 +477,7 @@ function tableInit(ctx){ }); $("#search-submit-"+ctx.tableName).click(function(e){ + e.preventDefault(); var searchTerm = $("#search-input-"+ctx.tableName).val(); tableParams.page = 1;
@@ -489,8 +491,6 @@ function tableInit(ctx){ } loadData(tableParams); - - e.preventDefault(); }); $('.remove-search-btn-'+ctx.tableName).click(function(e){
@@ -514,7 +514,9 @@ function tableInit(ctx){ e.preventDefault(); }); - $("#clear-filter-btn-"+ctx.tableName).click(function(){ + $("#clear-filter-btn-"+ctx.tableName).click(function(e){ + e.preventDefault(); + var filterBtn = $("#" + tableParams.filter.split(":")[0]); filterBtnActive(filterBtn, false);
Signature · 12 lines
1.9.3 --------------------------------------------------------------------- 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.