Skip to content

Commit

Permalink
Fixed collapsing tooltips (#756)
Browse files Browse the repository at this point in the history
* Fixed collapsing tooltips

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: nadar <[email protected]>
  • Loading branch information
hbugdoll and nadar authored Feb 19, 2024
1 parent 690ff30 commit 91ab9a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

## 5.0.2

+ [#756](https://github.com/luyadev/luya-module-admin/pull/756) Fixed collapsing tooltips due empty content in this case the tooltip is no longer displayed
+ [#755](https://github.com/luyadev/luya-module-admin/pull/755) Provided popup delay `tooltip-popup-delay` for tooltip directive.
+ [#754](https://github.com/luyadev/luya-module-admin/pull/754) Improved setup outputs.
+ [#754](https://github.com/luyadev/luya-module-admin/pull/754) Improved `admin/setup` command outputs.

## 5.0.1 (7. February 2024)

Expand Down
29 changes: 16 additions & 13 deletions src/resources/js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 tooltip tooltip-image-url="http://image.url">...</span>
* <span tooltip tooltip-expression="scopeFunction(fooBar)">Span Text</span>
* ```
*
*
*
* Change the position (`top`, `right`, `bottom` or `left`):
*
* ```html
Expand All @@ -155,20 +156,20 @@ zaa.directive("linkObjectToString", function () {
* ```
*
*
* In order to trigger an expression call instead of a static text use:
*
* ```html
* <span tooltip tooltip-expression="scopeFunction(fooBar)">Span Text</span>
* ```
*
*
* Display a tooltip with delay in milliseconds:
*
* ```html
* <span tooltip tooltip-text="Tooltip" tooltip-popup-delay="500">...</span>
* ```
*
*
* You can provide an Image URL beside or instead of text.
*
*
* ```html
* <span tooltip tooltip-image-url="http://image.url">...</span>
* ```
*
*
* Disable tooltip based on variable (two way binding):
*
* ```html
Expand Down Expand Up @@ -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 = '<div class="tooltip tooltip-' + (scope.tooltipPosition || defaultPosition) + (scope.tooltipImageUrl ? ' tooltip-image' : '') + '" role="tooltip">' +
Expand Down

0 comments on commit 91ab9a9

Please sign in to comment.