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 /bitbake/lib/toaster/toastergui/static/js | |
| 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>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/base.js | 4 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/importlayer.js | 6 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 2 |
3 files changed, 6 insertions, 6 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 |
