summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorBelen Barros Pena <belen.barros.pena@intel.com>2016-02-22 09:08:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-26 17:20:15 +0000
commitd4a663a70162afbd8e482d3fd858f4a7f6c956f7 (patch)
treeb566a059b372c76c6d342f17ef1065ca525d6923 /bitbake
parent48f0ae2c12475953643a60bcd122273eff012bed (diff)
downloadpoky-d4a663a70162afbd8e482d3fd858f4a7f6c956f7.tar.gz
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 <belen.barros.pena@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js3
1 files changed, 3 insertions, 0 deletions
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(){
36 function showError(text){ 36 function showError(text){
37 invalidNameHelp.text(text); 37 invalidNameHelp.text(text);
38 invalidNameHelp.show(); 38 invalidNameHelp.show();
39 nameInput.parent().addClass('error');
39 } 40 }
40 41
41 nameInput.on('keyup', function(){ 42 nameInput.on('keyup', function(){
@@ -47,9 +48,11 @@ function newCustomImageModalInit(){
47 if (nameInput.val().search(/[^a-z|0-9|-]/) != -1){ 48 if (nameInput.val().search(/[^a-z|0-9|-]/) != -1){
48 showError(invalidMsg); 49 showError(invalidMsg);
49 newCustomImgBtn.prop("disabled", true); 50 newCustomImgBtn.prop("disabled", true);
51 nameInput.parent().addClass('error');
50 } else { 52 } else {
51 invalidNameHelp.hide(); 53 invalidNameHelp.hide();
52 newCustomImgBtn.prop("disabled", false); 54 newCustomImgBtn.prop("disabled", false);
55 nameInput.parent().removeClass('error');
53 } 56 }
54 }); 57 });
55} 58}