summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2015-03-12 16:56:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-21 00:00:02 +0000
commitfc0cec1f38aa6f2d09434cc008a429d350a5706f (patch)
tree777a997124c8087bc021489036f419c45665e82e
parent23c83c6a8af12ad1c008372685f7cd9f87023145 (diff)
downloadbitbake-fc0cec1f38aa6f2d09434cc008a429d350a5706f.tar.gz
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] Signed-off-by: David Reyna <David.Reyna@windriver.com>
-rw-r--r--lib/toaster/toastergui/templates/projectconf.html18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/toaster/toastergui/templates/projectconf.html b/lib/toaster/toastergui/templates/projectconf.html
index ffdf760da..d8ead8199 100644
--- a/lib/toaster/toastergui/templates/projectconf.html
+++ b/lib/toaster/toastergui/templates/projectconf.html
@@ -468,7 +468,7 @@
// re-assert the event handlers
}
- /* ensure cookie exists {% csrf_token %} */
+ /* ensure cookie exists {% csrf_token %} */
function postEditAjaxRequest(reqdata) {
var ajax = $.ajax({
type:"POST",
@@ -621,10 +621,13 @@
// change IMAGE_INSTALL_append variable
$('#change-image_install-icon').click(function() {
// preset the edit value
- var current_val = $("span#image_install").text();
+ var current_val = $("span#image_install").text().trim();
if (current_val == "Not set") {
current_val="";
$("#apply-change-image_install").attr("disabled","disabled");
+ } else {
+ // insure these non-empty values have single space prefix
+ current_val=" " + current_val;
}
$("input#new-image_install").val(current_val);
@@ -643,7 +646,7 @@
});
$("#new-image_install").on('input', function(){
- if ($(this).val().length == 0) {
+ if ($(this).val().trim().length == 0) {
$("#apply-change-image_install").attr("disabled","disabled");
}
else {
@@ -652,13 +655,14 @@
});
$('#apply-change-image_install').click(function(){
- var name = $('#new-image_install').val();
- postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+name});
- $('#image_install').text(name);
+ // insure these non-empty values have single space prefix
+ var value = " " + $('#new-image_install').val().trim();
+ postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+value});
+ $('#image_install').text(value);
$('#image_install').removeClass('muted');
$("#change-image_install-form").slideUp(function () {
$('#image_install, #change-image_install-icon').show();
- if (name.length > -1) {
+ if (value.length > -1) {
$('#delete-image_install-icon').show();
setDeleteTooltip($('#delete-image_install-icon'));
}