Skip to content

Commit

Permalink
destroy existing tooltips, fixes TheCoder4eu#220 and fixes TheCoder4e…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhedar committed Apr 25, 2016
1 parent dadc723 commit c8f8586
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/bootsfaces/render/Tooltip.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public static void activateTooltips(FacesContext context, UIComponent component)
options = "{" + options.substring(0, options.length() - 1) + "}";

String js = "$(function () {\n" + "$('#" + id + "').tooltip(" + options + ")\n" + "});\n";
//destroy existing tooltips to prevent ajax bugs in some browsers and prevent memory leaks (see #323 and #220)
js+="$('.tooltip').tooltip('destroy'); ";
context.getResponseWriter().write("<script type='text/javascript'>" + js + "</script>");
}
}
Expand Down

0 comments on commit c8f8586

Please sign in to comment.