Skip to content

Commit

Permalink
tooltip.Base: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Dec 8, 2024
1 parent 713722c commit 333abb6
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/tooltip/Base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ class Base extends Container {
return singletons[app.name]
}

// Used as a delegate filter to activate on targets which have a tooltip configuration
static delegateFilter(path) {
for (let i = 0, { length } = path; i < length; i++) {
if (path[i].cls.includes('neo-uses-shared-tooltip') || path[i].data['neoTooltip']) {
return i
}
}
}

/**
* Instantly hides the tooltip
*/
Expand Down Expand Up @@ -278,22 +287,12 @@ class Base extends Container {
if (me.mounted) {
me.show();
me.alignTo()
}
else {
} else {
me.showDelayed(data)
}
}
}

// Used as a delegate filter to activate on targets which have a tooltip configuration
static delegateFilter(path) {
for (let i = 0, { length } = path; i < length; i++) {
if (path[i].cls.includes('neo-uses-shared-tooltip') || path[i].data['neoTooltip']) {
return i
}
}
}

/**
* @param {Object} data
*/
Expand Down

0 comments on commit 333abb6

Please sign in to comment.