diff --git a/wwwroot/js/garage.js b/wwwroot/js/garage.js index bab19de..e3c2166 100644 --- a/wwwroot/js/garage.js +++ b/wwwroot/js/garage.js @@ -45,15 +45,21 @@ function loadPinnedNotes(vehicleId) { new bootstrap.Tooltip(hoveredGrid); hoveredGrid.tooltip("show"); } else { + //disable the tooltip + //hoveredGrid.attr("data-bs-toggle", ""); hoveredGrid.attr("data-bs-title", ""); } }); } else { - hoveredGrid.tooltip("show"); + if (hoveredGrid.attr("data-bs-title") != '') { + hoveredGrid.tooltip("show"); + } } } function hidePinnedNotes(vehicleId) { - $(`#gridVehicle_${vehicleId}`).tooltip("hide"); + if ($(`#gridVehicle_${vehicleId}`).attr('data-bs-title') != '') { + $(`#gridVehicle_${vehicleId}`).tooltip("hide"); + } } function filterGarage(sender) { diff --git a/wwwroot/lib/bootstrap-tagsinput/bootstrap-tagsinput.js b/wwwroot/lib/bootstrap-tagsinput/bootstrap-tagsinput.js index 5493bd6..9bb0e20 100644 --- a/wwwroot/lib/bootstrap-tagsinput/bootstrap-tagsinput.js +++ b/wwwroot/lib/bootstrap-tagsinput/bootstrap-tagsinput.js @@ -429,12 +429,13 @@ self.$input.attr('disabled', 'disabled'); return; } - var text = $input.val(), maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars; if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached)) { - // Only attempt to add a tag if there is data in the field - if (text.length !== 0) { + //check if confirm keys are in input and then replace them. + text = text.replace(String.fromCharCode(event.which), "") + // Only attempt to add a tag if there is data in the field + if (text.length !== 0) { self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text); $input.val(''); }