From: Michael Wood Date: Thu, 24 Nov 2016 11:19:55 +0000 (+0000) Subject: toaster: customrecipejs Consume click event on 'a' link if disabled X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc8401e78cea140349bded228d38f72f628b3980;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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] Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/toastergui/static/js/customrecipe.js b/lib/toaster/toastergui/static/js/customrecipe.js index 9ea9602881a..8b1c190df99 100644 --- a/lib/toaster/toastergui/static/js/customrecipe.js +++ b/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(); + }); }