mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 15:05:26 +08:00
Set tooltips initialization to comply with turbolinks
Also add custom styling options as another data attribute.
This commit is contained in:
parent
c12f77d1d1
commit
9632d1cd01
1 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
|||
$('.help_tooltips').each(function(i, obj) {
|
||||
var link = $(obj).data('tooltiplink');
|
||||
var textData = $(obj).data('tooltipcontent');
|
||||
var customStyle = $(obj).data('tooltipstyle');
|
||||
|
||||
$(obj)
|
||||
.popover({
|
||||
|
@ -23,7 +24,9 @@
|
|||
placement: 'auto right',
|
||||
trigger: 'manual',
|
||||
content: 'popovers will not display if empty',
|
||||
template: '<div class="popover tooltip_' + i + '_window tooltip-open" role="tooltip" >'
|
||||
template:
|
||||
'<div class="popover tooltip_' + i + '_window tooltip-open" '
|
||||
+ 'role="tooltip" style="' + customStyle + '">'
|
||||
+ '<div class="popover-body" >' + textData + '</div>'
|
||||
+ '<br><br><br>'
|
||||
+ '<div class="popover-footer">'
|
||||
|
@ -78,7 +81,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$.initTooltips();
|
||||
});
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue