stopAllPopovers = function(){cat("stopAllPopovers\n")output$JSevaluation = renderUI({scriptString = paste('stopAllPopoversString ="$(\\"*[id^=\\\'pop\\\']\\").popover(\\\'destroy\\\');" ;','eval(stopAllPopoversString); ')tags$script( scriptString )} )}
stopAllPopoversString ="$(\"*[id^=\'pop\']\").popover(\'destroy\');" ;
observeEvent(input$togglePopovers, {cat('input$togglePopovers a', input$togglePopovers, '\n')if(input$togglePopovers)addAllPopovers()elsestopAllPopovers()})
input$togglePopovers FALSEstopAllPopoversinput$togglePopovers TRUEaddAllPopoversinput$togglePopovers FALSEstopAllPopoversinput$togglePopovers TRUEaddAllPopovers
Here is the code for shinyBS.addTooltip
function (id, type, opts) {
var $id = shinyBS.getTooltipTarget(id);
var dopts = {html: true};
opts = $.extend(opts, dopts);
if(type == "tooltip") {
$id.tooltip("destroy");
$id.tooltip(opts);
} else if(type == "popover") {
$id.popover("destroy");
$id.popover(opts);
}
}
Here is the suggested replacement, from https://github.com/ebailey78/shinyBS/issues/88:
shinyBS.addTooltip = function(id, type, opts) {
var $id = shinyBS.getTooltipTarget(id);
var dopts = {html: true};
opts = $.extend(opts, dopts);
if(type == "tooltip") {
$id.tooltip("destroy");
setTimeout(function() {$id.tooltip(opts);},200);
} else if(type == "popover") {
$id.popover("destroy");
setTimeout(function() {$id.popover(opts);},200);
}
}
and add the following to your ui: (assuming the file is named pop_patch.js)
singleton(tags$head(tags$script(src = "pop_patch.js"))),