[Toaster] [PATCH v2] toaster: customrecipejs Consume click event on 'a' link if disabled

Michael Wood michael.g.wood at intel.com
Tue Nov 1 05:08:17 PDT 2016


Consume the click event on the download recipe link if it's disabled. To
prevent the link from sending user to an error page.
See http://getbootstrap.com/css/#forms-disabled-fieldsets and a link
caveat.

[YOCTO #10151]

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
index 9ea9602..8b1c190 100644
--- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
+++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -312,5 +312,11 @@ function customRecipePageInit(ctx) {
     });
   });
 
+ /* Stop the download link from working if it is in disabled state
+  * http://getbootstrap.com/css/#forms-disabled-fieldsets
+  */
+ $("a[disabled=disabled]").click(function(e){
+   e.preventDefault();
+ });
 
 }
-- 
2.7.4



More information about the toaster mailing list