Skip to content

Commit 7cf8d14

Browse files
committed
Update Tooltip.php
1 parent e81e46d commit 7cf8d14

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

wfc/ui/vuetify/Tooltip.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,32 @@ public function __construct(HTMLNode $activator = null, HTMLNode $tooltip = null
3737
/**
3838
* Sets the element that will act as tooltip activator.
3939
*
40-
* @param HTMLNode $el
40+
* @param HTMLNode|string $el
41+
*
42+
* @return HTMLNode The method will return the added element.
4143
*/
42-
public function setActivator(HTMLNode $el) {
44+
public function setActivator($el) : HTMLNode {
4345
$this->contentArea->removeAllChildNodes();
44-
$el->setAttributes([
46+
$xEl = $this->contentArea->addChild($el);
47+
$xEl->setAttributes([
4548
'v-bind' => "attrs",
4649
'v-on' => "on",
4750
]);
48-
$this->contentArea->addChild($el);
51+
52+
return $xEl;
4953
}
5054
/**
5155
* Sets the element that will act as the tooltip.
5256
*
53-
* @param HTMLNode $el
57+
* @param HTMLNode|string $el
58+
*
59+
* @return HTMLNode The method will return the added element.
5460
*/
55-
public function setTooltip(HTMLNode $el) {
61+
public function setTooltip($el) : HTMLNode {
5662
if ($this->childrenCount() == 2) {
5763
$this->removeLastChild();
5864
}
59-
parent::addChild($el);
65+
return parent::addChild($el);
6066
}
6167
/**
6268
* Sets the position of the tooltip.

0 commit comments

Comments
 (0)