From 5194f0401ec038359397fd22654f46b3612fc3a6 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 6 Aug 2015 19:23:47 +0300 Subject: bitbake: toastergui: Move click disabled check after table ready event We were attaching this handler before the elements were fully ready in the dom. Which allowed these links although disabled to take users to the change machine page. (Bitbake rev: 8245a7d679914ca7d4548ab7e83b5047ff8a1ff5) Signed-off-by: Michael Wood Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index 96372f06f4..d9ba687354 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -202,6 +202,12 @@ function layerDetailsPageInit (ctx) { /* re run the machinesTabShow to update the text */ machinesTabShow(); } + + $(".select-machine-btn").click(function(e){ + if ($(this).attr("disabled") === "disabled") + e.preventDefault(); + }); + }); $("#targets-tab").on('show', targetsTabShow); @@ -385,10 +391,6 @@ function layerDetailsPageInit (ctx) { $(this).parents("form").submit(); }); - $(".select-machine-btn").click(function(e){ - if ($(this).attr("disabled") === "disabled") - e.preventDefault(); - }); layerDepsList.find(".icon-trash").click(layerDepRemoveClick); layerDepsList.find("a").tooltip(); -- cgit v1.2.3-54-g00ecf