From d4a663a70162afbd8e482d3fd858f4a7f6c956f7 Mon Sep 17 00:00:00 2001 From: Belen Barros Pena Date: Mon, 22 Feb 2016 09:08:34 +0000 Subject: bitbake: 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. (Bitbake rev: df342e7662179410467c47cd870180ea75f863d4) Signed-off-by: Belen Barros Pena Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js index 0b9d31aa6c..328997af3b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +++ b/bitbake/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'); } }); } -- cgit v1.2.3-54-g00ecf