From bb851d1113ceb1256c0bd078a35fc32ad2a05124 Mon Sep 17 00:00:00 2001 From: Hendrik Bugdoll Date: Sun, 18 Feb 2024 23:30:00 +0100 Subject: [PATCH 1/3] Fixed collapsing tooltips --- src/resources/js/directives.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/resources/js/directives.js b/src/resources/js/directives.js index 649aabd54..d6d7a2100 100644 --- a/src/resources/js/directives.js +++ b/src/resources/js/directives.js @@ -135,12 +135,13 @@ zaa.directive("linkObjectToString", function () { * ``` * * - * You can provide an Image URL beside or instead of text. + * In order to trigger an expression call instead of a static text use: * * ```html - * ... + * Span Text * ``` - * + * + * * Change the position (`top`, `right`, `bottom` or `left`): * * ```html @@ -155,20 +156,20 @@ zaa.directive("linkObjectToString", function () { * ``` * * - * In order to trigger an expression call instead of a static text use: - * - * ```html - * Span Text - * ``` - * - * * Display a tooltip with delay in milliseconds: * * ```html * ... * ``` + * + * + * You can provide an Image URL beside or instead of text. * - * + * ```html + * ... + * ``` + * + * * Disable tooltip based on variable (two way binding): * * ```html @@ -262,8 +263,10 @@ zaa.directive("tooltip", ['$document', '$http', '$timeout', function ($document, } // Generate tooltip HTML for the first time - if ((!scope.pop || lastValue != scope.tooltipText) && (typeof scope.tooltipDisabled === 'undefined' || scope.tooltipDisabled === false)) { - + if ( (!scope.pop || lastValue != scope.tooltipText) + && (typeof scope.tooltipDisabled === 'undefined' || scope.tooltipDisabled === false) + && (scope.tooltipText || scope.tooltipImageUrl || scope.tooltipPreviewUrl) ) { + lastValue = scope.tooltipText var html = '