[oe-commits] [bitbake] 07/20: toaster: apply error class to name field

git at git.openembedded.org git at git.openembedded.org
Thu Feb 25 17:59:24 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 288006592d45701ea5d4a759bcdcc7e01596efd9
Author: Belen Barros Pena <belen.barros.pena at intel.com>
AuthorDate: Mon Feb 22 09:08:34 2016 +0000

    toaster: apply error class to name field
    
    The form for naming new custom images shows you an error message when
    the name already exists or you include an invalid character in it. But
    when an error appears, the input field was missing the red highlight.
    
    This patch applies the right class to the form controls whenever an
    error message is shown.
    
    Signed-off-by: Belen Barros Pena <belen.barros.pena at intel.com>
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/toastergui/static/js/newcustomimage_modal.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/lib/toaster/toastergui/static/js/newcustomimage_modal.js
index 0b9d31a..328997a 100644
--- a/lib/toaster/toastergui/static/js/newcustomimage_modal.js
+++ b/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -36,6 +36,7 @@ function newCustomImageModalInit(){
   function showError(text){
     invalidNameHelp.text(text);
     invalidNameHelp.show();
+    nameInput.parent().addClass('error');
   }
 
   nameInput.on('keyup', function(){
@@ -47,9 +48,11 @@ function newCustomImageModalInit(){
     if (nameInput.val().search(/[^a-z|0-9|-]/) != -1){
       showError(invalidMsg);
       newCustomImgBtn.prop("disabled", true);
+      nameInput.parent().addClass('error');
     } else {
       invalidNameHelp.hide();
       newCustomImgBtn.prop("disabled", false);
+      nameInput.parent().removeClass('error');
     }
   });
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list