diff options
author | David Reyna <David.Reyna@windriver.com> | 2015-03-12 16:56:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-21 00:00:28 +0000 |
commit | 12c7efe40addfbc5f02a105ad62eccdf5f9d9c82 (patch) | |
tree | 410e134fb155309ba4d1d8a6144d352e2f03d18e /bitbake/lib/toaster | |
parent | d2b20465c3c806efb54a7ef8bedc53f90f27ed4f (diff) | |
download | poky-12c7efe40addfbc5f02a105ad62eccdf5f9d9c82.tar.gz |
bitbake: toaster: insure IMAGE_INSTALL_append values have a space prefix
When the IMAGE_INSTALL_append value is not empty, it must have a space prefix
in order for the "append" operator to concatenate the values correctly, so we
enforce it in this variable's submit javascript.
[YOCTO #7394]
(Bitbake rev: fc0cec1f38aa6f2d09434cc008a429d350a5706f)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/projectconf.html | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index ffdf760dab..d8ead8199b 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html | |||
@@ -468,7 +468,7 @@ | |||
468 | // re-assert the event handlers | 468 | // re-assert the event handlers |
469 | } | 469 | } |
470 | 470 | ||
471 | /* ensure cookie exists {% csrf_token %} */ | 471 | /* ensure cookie exists {% csrf_token %} */ |
472 | function postEditAjaxRequest(reqdata) { | 472 | function postEditAjaxRequest(reqdata) { |
473 | var ajax = $.ajax({ | 473 | var ajax = $.ajax({ |
474 | type:"POST", | 474 | type:"POST", |
@@ -621,10 +621,13 @@ | |||
621 | // change IMAGE_INSTALL_append variable | 621 | // change IMAGE_INSTALL_append variable |
622 | $('#change-image_install-icon').click(function() { | 622 | $('#change-image_install-icon').click(function() { |
623 | // preset the edit value | 623 | // preset the edit value |
624 | var current_val = $("span#image_install").text(); | 624 | var current_val = $("span#image_install").text().trim(); |
625 | if (current_val == "Not set") { | 625 | if (current_val == "Not set") { |
626 | current_val=""; | 626 | current_val=""; |
627 | $("#apply-change-image_install").attr("disabled","disabled"); | 627 | $("#apply-change-image_install").attr("disabled","disabled"); |
628 | } else { | ||
629 | // insure these non-empty values have single space prefix | ||
630 | current_val=" " + current_val; | ||
628 | } | 631 | } |
629 | $("input#new-image_install").val(current_val); | 632 | $("input#new-image_install").val(current_val); |
630 | 633 | ||
@@ -643,7 +646,7 @@ | |||
643 | }); | 646 | }); |
644 | 647 | ||
645 | $("#new-image_install").on('input', function(){ | 648 | $("#new-image_install").on('input', function(){ |
646 | if ($(this).val().length == 0) { | 649 | if ($(this).val().trim().length == 0) { |
647 | $("#apply-change-image_install").attr("disabled","disabled"); | 650 | $("#apply-change-image_install").attr("disabled","disabled"); |
648 | } | 651 | } |
649 | else { | 652 | else { |
@@ -652,13 +655,14 @@ | |||
652 | }); | 655 | }); |
653 | 656 | ||
654 | $('#apply-change-image_install').click(function(){ | 657 | $('#apply-change-image_install').click(function(){ |
655 | var name = $('#new-image_install').val(); | 658 | // insure these non-empty values have single space prefix |
656 | postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+name}); | 659 | var value = " " + $('#new-image_install').val().trim(); |
657 | $('#image_install').text(name); | 660 | postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+value}); |
661 | $('#image_install').text(value); | ||
658 | $('#image_install').removeClass('muted'); | 662 | $('#image_install').removeClass('muted'); |
659 | $("#change-image_install-form").slideUp(function () { | 663 | $("#change-image_install-form").slideUp(function () { |
660 | $('#image_install, #change-image_install-icon').show(); | 664 | $('#image_install, #change-image_install-icon').show(); |
661 | if (name.length > -1) { | 665 | if (value.length > -1) { |
662 | $('#delete-image_install-icon').show(); | 666 | $('#delete-image_install-icon').show(); |
663 | setDeleteTooltip($('#delete-image_install-icon')); | 667 | setDeleteTooltip($('#delete-image_install-icon')); |
664 | } | 668 | } |