diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-02-06 19:18:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-17 14:38:31 +0000 |
commit | d8d0db1701b4ccc0668041f84813c2e4ca57bee9 (patch) | |
tree | 3db5b0c667471c2805e1f5f89b3161b1eb3fd965 | |
parent | fdb5639e906779814e8454b8fc696c25e8c7a870 (diff) | |
download | poky-d8d0db1701b4ccc0668041f84813c2e4ca57bee9.tar.gz |
bitbake: 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]
(Bitbake rev: 2060be8d31baa0cd302aa8dc0b6d179df853ee99)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 files changed, 11 insertions, 11 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js index 619ad287c4..0302b804fc 100644 --- a/bitbake/lib/toaster/toastergui/static/js/base.js +++ b/bitbake/lib/toaster/toastergui/static/js/base.js | |||
@@ -71,13 +71,13 @@ function basePageInit (ctx) { | |||
71 | /* Any typing in the input apart from enter key is going to invalidate | 71 | /* Any typing in the input apart from enter key is going to invalidate |
72 | * the value that has been set by selecting a suggestion from the typeahead | 72 | * the value that has been set by selecting a suggestion from the typeahead |
73 | */ | 73 | */ |
74 | newBuildProjectInput.keyup(function(event) { | 74 | newBuildProjectInput.on('input', function(event) { |
75 | if (event.keyCode == 13) | 75 | if (event.keyCode == 13) |
76 | return; | 76 | return; |
77 | newBuildProjectSaveBtn.attr("disabled", "disabled"); | 77 | newBuildProjectSaveBtn.attr("disabled", "disabled"); |
78 | }); | 78 | }); |
79 | 79 | ||
80 | newBuildTargetInput.keyup(function() { | 80 | newBuildTargetInput.on('input', function() { |
81 | if ($(this).val().length == 0) | 81 | if ($(this).val().length == 0) |
82 | newBuildTargetBuildBtn.attr("disabled", "disabled"); | 82 | newBuildTargetBuildBtn.attr("disabled", "disabled"); |
83 | else | 83 | else |
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index d6e140ffdc..e782bda120 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js | |||
@@ -245,15 +245,15 @@ function importLayerPageInit (ctx) { | |||
245 | enable_import_btn(true); | 245 | enable_import_btn(true); |
246 | } | 246 | } |
247 | 247 | ||
248 | vcsURLInput.keyup(function() { | 248 | vcsURLInput.on('input', function() { |
249 | check_form(); | 249 | check_form(); |
250 | }); | 250 | }); |
251 | 251 | ||
252 | gitRefInput.keyup(function() { | 252 | gitRefInput.on('input', function() { |
253 | check_form(); | 253 | check_form(); |
254 | }); | 254 | }); |
255 | 255 | ||
256 | layerNameInput.keyup(function() { | 256 | layerNameInput.on('input', function() { |
257 | if ($(this).val() && !validLayerName.test($(this).val())){ | 257 | if ($(this).val() && !validLayerName.test($(this).val())){ |
258 | layerNameCtrl.addClass("error") | 258 | layerNameCtrl.addClass("error") |
259 | $("#invalid-layer-name-hint").show(); | 259 | $("#invalid-layer-name-hint").show(); |
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index 99552de8c1..2e713d5a0f 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js | |||
@@ -353,7 +353,7 @@ function layerDetailsPageInit (ctx) { | |||
353 | }); | 353 | }); |
354 | 354 | ||
355 | /* Disable the change button when we have no data in the input */ | 355 | /* Disable the change button when we have no data in the input */ |
356 | $("dl input, dl textarea").keyup(function() { | 356 | $("dl input, dl textarea").on("input",function() { |
357 | if ($(this).val().length == 0) | 357 | if ($(this).val().length == 0) |
358 | $(this).parent().children(".change-btn").attr("disabled", "disabled"); | 358 | $(this).parent().children(".change-btn").attr("disabled", "disabled"); |
359 | else | 359 | else |
diff --git a/bitbake/lib/toaster/toastergui/templates/newproject.html b/bitbake/lib/toaster/toastergui/templates/newproject.html index 0265564762..dcb6590642 100644 --- a/bitbake/lib/toaster/toastergui/templates/newproject.html +++ b/bitbake/lib/toaster/toastergui/templates/newproject.html | |||
@@ -72,7 +72,7 @@ | |||
72 | $('.btn-primary').attr('disabled', 'disabled'); | 72 | $('.btn-primary').attr('disabled', 'disabled'); |
73 | 73 | ||
74 | // enable submit button when all required fields are populated | 74 | // enable submit button when all required fields are populated |
75 | $("input#new-project-name").keyup(function() { | 75 | $("input#new-project-name").on('input', function() { |
76 | if ($("input#new-project-name").val().length > 0 ){ | 76 | if ($("input#new-project-name").val().length > 0 ){ |
77 | $('.btn-primary').removeAttr('disabled'); | 77 | $('.btn-primary').removeAttr('disabled'); |
78 | $(".help-inline").css('visibility','hidden'); | 78 | $(".help-inline").css('visibility','hidden'); |
diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index edcad1821f..0d38a9228b 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html | |||
@@ -269,7 +269,7 @@ | |||
269 | }); | 269 | }); |
270 | }); | 270 | }); |
271 | 271 | ||
272 | $(".js-new-config_var").keyup(function(){ | 272 | $(".js-new-config_var").on('input', function(){ |
273 | if ($(this).val().length == 0) { | 273 | if ($(this).val().length == 0) { |
274 | $(".js-apply-change-config_var").attr("disabled","disabled"); | 274 | $(".js-apply-change-config_var").attr("disabled","disabled"); |
275 | } | 275 | } |
@@ -386,7 +386,7 @@ | |||
386 | }); | 386 | }); |
387 | }); | 387 | }); |
388 | 388 | ||
389 | $("#new-distro").keyup(function(){ | 389 | $("#new-distro").on('input', function(){ |
390 | if ($(this).val().length == 0) { | 390 | if ($(this).val().length == 0) { |
391 | $("#apply-change-distro").attr("disabled","disabled"); | 391 | $("#apply-change-distro").attr("disabled","disabled"); |
392 | } | 392 | } |
@@ -469,7 +469,7 @@ | |||
469 | }); | 469 | }); |
470 | }); | 470 | }); |
471 | 471 | ||
472 | $("#new-image_install").keyup(function(){ | 472 | $("#new-image_install").on('input', function(){ |
473 | if ($(this).val().length == 0) { | 473 | if ($(this).val().length == 0) { |
474 | $("#apply-change-image_install").attr("disabled","disabled"); | 474 | $("#apply-change-image_install").attr("disabled","disabled"); |
475 | } | 475 | } |
@@ -629,7 +629,7 @@ | |||
629 | }); | 629 | }); |
630 | 630 | ||
631 | //activate / deactivate save added variable button | 631 | //activate / deactivate save added variable button |
632 | $("#variable, #value").keyup(function() { | 632 | $("#variable, #value").on('input', function() { |
633 | if ( $("#variable").val().length > 0 && $("#value").val().trim().length > 0 ) { | 633 | if ( $("#variable").val().length > 0 && $("#value").val().trim().length > 0 ) { |
634 | $(".save").removeAttr("disabled"); | 634 | $(".save").removeAttr("disabled"); |
635 | } | 635 | } |