From 977ee7192ff3d95ae69cfdd56de3bd61c7dcd73d Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Fri, 12 Jan 2018 08:11:27 +0100 Subject: [PATCH] Create helpers for tooltips --- src/js/yunohost/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index 595c218b..dc5b6625 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -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( + '' + + options.fn(this) + + ''); + }); + + // Load tooltips on the page; needed if using tooltips + Handlebars.registerHelper('load_tooltips', function() { + return new Handlebars.SafeString( + ''); + }); // Look for supported type of storage to use /**