]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: customrecipejs Consume click event on 'a' link if disabled
authorMichael Wood <michael.g.wood@intel.com>
Thu, 24 Nov 2016 11:19:55 +0000 (11:19 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Nov 2016 15:47:46 +0000 (15:47 +0000)
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@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/toastergui/static/js/customrecipe.js

index 9ea9602881ad80e3351f77564742a3e369e92663..8b1c190df994dcb4ecf0cb9444a5573b0f7742ca 100644 (file)
@@ -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();
+ });
 
 }