Using popover component to confirm hotkeys replacement
This commit is contained in:
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');
|
||||
|
||||
@@ -66,9 +66,7 @@ OHIF.ui.showPopover = (templateName, popoverData, options={}) => {
|
||||
const view = Blaze.renderWithData(template, templateData, $popoverContent[0]);
|
||||
$element.one('hidden.bs.popover', () => {
|
||||
Blaze.remove(view);
|
||||
if (popoverOptions.trigger !== 'manual') {
|
||||
$element.popover('destroy');
|
||||
}
|
||||
$element.popover('destroy');
|
||||
});
|
||||
|
||||
promise.then(dismissPopover).catch(dismissPopover);
|
||||
|
||||
Reference in new issue
Block a user