Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CA75AE00852; Wed, 17 Feb 2016 02:55:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A35BBE007DC for ; Wed, 17 Feb 2016 02:55:03 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 17 Feb 2016 02:55:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,459,1449561600"; d="scan'208";a="904313658" Received: from tpalli-mobl2.ger.corp.intel.com (HELO bbarrosp-mac03.local.com) ([10.252.16.76]) by fmsmga001.fm.intel.com with ESMTP; 17 Feb 2016 02:55:02 -0800 From: Belen Barros Pena To: toaster@yoctoproject.org Date: Wed, 17 Feb 2016 11:54:50 +0100 Message-Id: <1455706490-23680-2-git-send-email-belen.barros.pena@linux.intel.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: <1455706490-23680-1-git-send-email-belen.barros.pena@linux.intel.com> References: <1455706490-23680-1-git-send-email-belen.barros.pena@linux.intel.com> Subject: [PATCH 2/2] toaster: apply error class to name field X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2016 10:55:06 -0000 From: Belen Barros Pena 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 hihglight. This patch applies the right class to the form controls whenever an error message is shown. Signed-off-by: Belen Barros Pena --- bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js index 0b9d31a..328997a 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'); } }); } -- 2.5.4 (Apple Git-61)