aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/static/js
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-02-06 19:18:19 +0000
committerAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-16 17:48:29 +0000
commit2060be8d31baa0cd302aa8dc0b6d179df853ee99 (patch)
treeab2a30367c35466a4b8932cfb29073a48f620550 /lib/toaster/toastergui/static/js
parent2e4a03db967ac1459b2764108fc54c4566a7e371 (diff)
downloadbitbake-contrib-2060be8d31baa0cd302aa8dc0b6d179df853ee99.tar.gz
toaster: Use on input event for validation rather than keyup
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>
Diffstat (limited to 'lib/toaster/toastergui/static/js')
-rw-r--r--lib/toaster/toastergui/static/js/base.js4
-rw-r--r--lib/toaster/toastergui/static/js/importlayer.js6
-rw-r--r--lib/toaster/toastergui/static/js/layerdetails.js2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/toaster/toastergui/static/js/base.js b/lib/toaster/toastergui/static/js/base.js
index 619ad287c..0302b804f 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 d6e140ffd..e782bda12 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 99552de8c..2e713d5a0 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