[Toaster] [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event

Michael Wood michael.g.wood at intel.com
Thu Aug 6 07:16:24 PDT 2015


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.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 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 be6bbcd..d12d3ae 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();
-- 
2.1.4



More information about the toaster mailing list