Using popover component to confirm hotkeys replacement

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2017-06-14 09:19:49 +02:00
1 parent 661f5b1e4c
commit ecef6d5af2
5 files changed
+97 -23

No files matched your search

@@ -94,16 +94,18 @@ OHIF.mixins.formItem = new OHIF.Mixin({
// Toggle the tooltip over the component
component.toggleTooltip = (isShow, message) => {
if (isShow && message) {
// Stop here if the tooltip is already created
if (component.$wrapper.next('.tooltip').length) {
return;
const tooltipId = component.$wrapper.attr('aria-describedby');
const $tooltip = $(document.getElementById(tooltipId));
if ($tooltip.length) {
// Change the message if the tooltip is already created
$tooltip.find('.tooltip-inner').text(message);
} else {
// Destroy the tooltip if already created, creating it again
component.$wrapper.tooltip('destroy').tooltip({
trigger: 'manual',
title: message
}).tooltip('show');
}
// Destroy the tooltip if created and create again
component.$wrapper.tooltip('destroy').tooltip({
trigger: 'manual',
title: message
}).tooltip('show');
} else {
// Destroy the tooltip
component.$wrapper.tooltip('destroy');