Skip to contentSkip to conversation

toaster: customrecipejs Eat click even on a link if disabled

PATCH Superseded Michael Wood 1 participant 2 messages Oct 31, 2016 – Nov 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: customrecipejs Eat click even on a link if disabled

Eat the click event on the download recipe link if it's disabled. See http://getbootstrap.com/css/#forms-disabled-fieldsets and a link caveat.

[YOCTO #10151]

---
 bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 6 ++++++
 1 file changed, 6 insertions(+)
bitbake/lib/toaster/toastergui/static/js/customrecipe.js +6 -0
index 9ea9602..8b1c190 100644
@@ -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();
+ });
 
 }
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 toaster: customrecipejs Consume click event on 'a' link if disabled

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]

---
 bitbake/lib/toaster/toastergui/static/js/customrecipe.js | 6 ++++++
 1 file changed, 6 insertions(+)
bitbake/lib/toaster/toastergui/static/js/customrecipe.js +6 -0
index 9ea9602..8b1c190 100644
@@ -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();
+ });
 
 }
Signature · 1 line
2.7.4