Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BDC86E00E47; Tue, 13 Oct 2015 09:43:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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] * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.88 listed in list.dnswl.org] Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 987C9E00AD1 for ; Tue, 13 Oct 2015 09:43:30 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 13 Oct 2015 09:43:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,678,1437462000"; d="scan'208";a="579927267" Received: from bbarrosp-mac03.isw.intel.com ([10.237.224.32]) by FMSMGA003.fm.intel.com with ESMTP; 13 Oct 2015 09:43:23 -0700 From: Belen Barros Pena To: toaster@yoctoproject.org Date: Tue, 13 Oct 2015 17:43:21 +0100 Message-Id: <1444754601-33174-1-git-send-email-belen.barros.pena@linux.intel.com> X-Mailer: git-send-email 2.3.8 (Apple Git-58) Subject: [PATCH] toaster: Disable add layer button when input is empty 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: Tue, 13 Oct 2015 16:43:35 -0000 From: Belen Barros Pena The 'add layer' button in the project configuration page is enabled when you select a layer from the type ahead. However, if you delete the layer name, the 'add layer' button remains enabled, and if you click it, the last selected layer from the type ahead will be added to the project. It is probably better to disable the 'add layer' button when the input field is empty. [YOCTO #8449] Signed-off-by: Belen Barros Pena --- bitbake/lib/toaster/toastergui/static/js/projectpage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/bitbake/lib/toaster/toastergui/static/js/projectpage.js index 30989a0..811aff3 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projectpage.js +++ b/bitbake/lib/toaster/toastergui/static/js/projectpage.js @@ -103,6 +103,12 @@ function projectPageInit(ctx) { layerAddBtn.removeAttr("disabled"); }); + layerAddInput.keyup(function(){ + if ( $(this).val().length == 0 ) { + layerAddBtn.attr("disabled","disabled") + } + }); + layerAddBtn.click(function(e){ e.preventDefault(); var layerObj = currentLayerAddSelection; -- 2.3.8 (Apple Git-58)