mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Create helpers for tooltips
This commit is contained in:
parent
c8c97204cb
commit
977ee7192f
1 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,23 @@
|
|||
return new Handlebars.SafeString(result);
|
||||
});
|
||||
|
||||
// Block helper to add a tooltip to any element
|
||||
Handlebars.registerHelper('tooltip', function(tooltip, options) {
|
||||
return new Handlebars.SafeString(
|
||||
'<span data-toggle="tooltip" title="' + tooltip + '" data-placement="right">'
|
||||
+ options.fn(this)
|
||||
+ '</span>');
|
||||
});
|
||||
|
||||
// Load tooltips on the page; needed if using tooltips
|
||||
Handlebars.registerHelper('load_tooltips', function() {
|
||||
return new Handlebars.SafeString(
|
||||
'<script>'
|
||||
+ '$(document).ready(function(){'
|
||||
+ '$(\'[data-toggle="tooltip"]\').tooltip();'
|
||||
+ '});'
|
||||
+ '</script>');
|
||||
});
|
||||
|
||||
// Look for supported type of storage to use
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue