All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex DAMIAN <alexandru.damian@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 01/10] toaster: Use on input event for validation rather than keyup
Date: Mon, 16 Feb 2015 17:53:17 +0000	[thread overview]
Message-ID: <2060be8d31baa0cd302aa8dc0b6d179df853ee99.1424108976.git.alexandru.damian@intel.com> (raw)
In-Reply-To: <cover.1424108976.git.alexandru.damian@intel.com>

From: Michael Wood <michael.g.wood@intel.com>

Avoid using keyup event to trigger form validation as this won't fire
for events such as pasting or autofill from the browser.

[YOCTO #7292]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 lib/toaster/toastergui/static/js/base.js          | 4 ++--
 lib/toaster/toastergui/static/js/importlayer.js   | 6 +++---
 lib/toaster/toastergui/static/js/layerdetails.js  | 2 +-
 lib/toaster/toastergui/templates/newproject.html  | 2 +-
 lib/toaster/toastergui/templates/projectconf.html | 8 ++++----
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/toaster/toastergui/static/js/base.js b/lib/toaster/toastergui/static/js/base.js
index 619ad28..0302b80 100644
--- a/lib/toaster/toastergui/static/js/base.js
+++ b/lib/toaster/toastergui/static/js/base.js
@@ -71,13 +71,13 @@ function basePageInit (ctx) {
     /* Any typing in the input apart from enter key is going to invalidate
      * the value that has been set by selecting a suggestion from the typeahead
      */
-    newBuildProjectInput.keyup(function(event) {
+    newBuildProjectInput.on('input', function(event) {
         if (event.keyCode == 13)
           return;
         newBuildProjectSaveBtn.attr("disabled", "disabled");
     });
 
-    newBuildTargetInput.keyup(function() {
+    newBuildTargetInput.on('input', function() {
       if ($(this).val().length == 0)
         newBuildTargetBuildBtn.attr("disabled", "disabled");
       else
diff --git a/lib/toaster/toastergui/static/js/importlayer.js b/lib/toaster/toastergui/static/js/importlayer.js
index d6e140f..e782bda 100644
--- a/lib/toaster/toastergui/static/js/importlayer.js
+++ b/lib/toaster/toastergui/static/js/importlayer.js
@@ -245,15 +245,15 @@ function importLayerPageInit (ctx) {
       enable_import_btn(true);
   }
 
-  vcsURLInput.keyup(function() {
+  vcsURLInput.on('input', function() {
     check_form();
   });
 
-  gitRefInput.keyup(function() {
+  gitRefInput.on('input', function() {
     check_form();
   });
 
-  layerNameInput.keyup(function() {
+  layerNameInput.on('input', function() {
     if ($(this).val() && !validLayerName.test($(this).val())){
       layerNameCtrl.addClass("error")
       $("#invalid-layer-name-hint").show();
diff --git a/lib/toaster/toastergui/static/js/layerdetails.js b/lib/toaster/toastergui/static/js/layerdetails.js
index 99552de..2e713d5 100644
--- a/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/lib/toaster/toastergui/static/js/layerdetails.js
@@ -353,7 +353,7 @@ function layerDetailsPageInit (ctx) {
   });
 
   /* Disable the change button when we have no data in the input */
-  $("dl input, dl textarea").keyup(function() {
+  $("dl input, dl textarea").on("input",function() {
     if ($(this).val().length == 0)
       $(this).parent().children(".change-btn").attr("disabled", "disabled");
     else
diff --git a/lib/toaster/toastergui/templates/newproject.html b/lib/toaster/toastergui/templates/newproject.html
index 0265564..dcb6590 100644
--- a/lib/toaster/toastergui/templates/newproject.html
+++ b/lib/toaster/toastergui/templates/newproject.html
@@ -72,7 +72,7 @@
             $('.btn-primary').attr('disabled', 'disabled');
 
             // enable submit button when all required fields are populated
-            $("input#new-project-name").keyup(function() {
+            $("input#new-project-name").on('input', function() {
                 if ($("input#new-project-name").val().length > 0 ){
                     $('.btn-primary').removeAttr('disabled');
                     $(".help-inline").css('visibility','hidden');
diff --git a/lib/toaster/toastergui/templates/projectconf.html b/lib/toaster/toastergui/templates/projectconf.html
index edcad18..0d38a92 100644
--- a/lib/toaster/toastergui/templates/projectconf.html
+++ b/lib/toaster/toastergui/templates/projectconf.html
@@ -269,7 +269,7 @@
                 });
             });
 
-            $(".js-new-config_var").keyup(function(){
+            $(".js-new-config_var").on('input', function(){
                 if ($(this).val().length == 0) {
                     $(".js-apply-change-config_var").attr("disabled","disabled");
                 }
@@ -386,7 +386,7 @@
                 });
             });
 
-            $("#new-distro").keyup(function(){
+            $("#new-distro").on('input', function(){
                 if ($(this).val().length == 0) {
                     $("#apply-change-distro").attr("disabled","disabled");
                 }
@@ -469,7 +469,7 @@
                 });
             });
 
-            $("#new-image_install").keyup(function(){
+            $("#new-image_install").on('input', function(){
                 if ($(this).val().length == 0) {
                     $("#apply-change-image_install").attr("disabled","disabled");
                 }
@@ -629,7 +629,7 @@
             });
 
             //activate / deactivate save added variable button
-            $("#variable, #value").keyup(function() {
+            $("#variable, #value").on('input', function() {
                 if ( $("#variable").val().length > 0  && $("#value").val().trim().length > 0 ) {
                     $(".save").removeAttr("disabled");
                 }
-- 
1.9.1



  reply	other threads:[~2015-02-16 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 17:53 [PATCH 00/10] Toaster patchset pull request Alex DAMIAN
2015-02-16 17:53 ` Alex DAMIAN [this message]
2015-02-16 17:53 ` [PATCH 02/10] toaster: properly detect failed server start Alex DAMIAN
2015-02-16 17:53 ` [PATCH 03/10] toaster: fix git checkout command Alex DAMIAN
2015-02-16 17:53 ` [PATCH 04/10] toaster: layerdetails use new vcs reference api Alex DAMIAN
2015-02-16 17:53 ` [PATCH 05/10] toaster: Additional fixes for the project variable page Alex DAMIAN
2015-02-16 17:53 ` [PATCH 06/10] toaster: New build button allow arbitrary build targets Alex DAMIAN
2015-02-16 17:53 ` [PATCH 07/10] toaster: Remove Layer source from machines, layers and targets Alex DAMIAN
2015-02-16 17:53 ` [PATCH 08/10] toaster: Remove filtering from layers, machines " Alex DAMIAN
2015-02-16 17:53 ` [PATCH 09/10] toaster: Set the machines page default pagesize to 100 Alex DAMIAN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2060be8d31baa0cd302aa8dc0b6d179df853ee99.1424108976.git.alexandru.damian@intel.com \
    --to=alexandru.damian@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.