mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Restore missing click & double click events on tab
This commit is contained in:
parent
076694187c
commit
041cb3b390
@ -2,6 +2,7 @@ import {Et2Widget} from "../../Et2Widget/Et2Widget";
|
|||||||
import {SlTab} from "@shoelace-style/shoelace";
|
import {SlTab} from "@shoelace-style/shoelace";
|
||||||
import shoelace from "../../Styles/shoelace";
|
import shoelace from "../../Styles/shoelace";
|
||||||
import {css} from "lit";
|
import {css} from "lit";
|
||||||
|
import {property} from "lit/decorators/property.js";
|
||||||
|
|
||||||
export class Et2Tab extends Et2Widget(SlTab)
|
export class Et2Tab extends Et2Widget(SlTab)
|
||||||
{
|
{
|
||||||
@ -20,20 +21,31 @@ export class Et2Tab extends Et2Widget(SlTab)
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
static get properties()
|
@property({type: Function})
|
||||||
{
|
ondblclick;
|
||||||
return {
|
|
||||||
...super.properties,
|
|
||||||
|
|
||||||
hidden: {type: Boolean, reflect: true}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.hidden = false;
|
this.hidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectedCallback()
|
||||||
|
{
|
||||||
|
super.connectedCallback();
|
||||||
|
|
||||||
|
if(this.ondblclick)
|
||||||
|
{
|
||||||
|
this.addEventListener("dblclick", this.ondblclick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectedCallback()
|
||||||
|
{
|
||||||
|
super.disconnectedCallback()
|
||||||
|
|
||||||
|
this.removeEventListener("dblclick", this.ondblclick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("et2-tab", Et2Tab);
|
customElements.define("et2-tab", Et2Tab);
|
@ -272,6 +272,8 @@ export class Et2Tabs extends Et2InputWidget(SlTabGroup) implements et2_IResizeab
|
|||||||
tabData.push({
|
tabData.push({
|
||||||
"id": index_name,
|
"id": index_name,
|
||||||
"label": this.egw().lang(et2_readAttrWithDefault(node, "label", "Tab")),
|
"label": this.egw().lang(et2_readAttrWithDefault(node, "label", "Tab")),
|
||||||
|
"onclick": et2_readAttrWithDefault(node, "onclick", ''),
|
||||||
|
"ondblclick": et2_readAttrWithDefault(node, "ondblclick", ''),
|
||||||
"widget": null,
|
"widget": null,
|
||||||
"widget_options": widget_options,
|
"widget_options": widget_options,
|
||||||
"contentDiv": null,
|
"contentDiv": null,
|
||||||
@ -347,7 +349,9 @@ export class Et2Tabs extends Et2InputWidget(SlTabGroup) implements et2_IResizeab
|
|||||||
slot: "nav",
|
slot: "nav",
|
||||||
panel: tab.id,
|
panel: tab.id,
|
||||||
active: index == this._selectedIndex,
|
active: index == this._selectedIndex,
|
||||||
hidden: tab.hidden
|
hidden: tab.hidden,
|
||||||
|
onclick: tab.onclick,
|
||||||
|
ondblclick: tab.ondblclick
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
// Set tab label
|
// Set tab label
|
||||||
|
Loading…
Reference in New Issue
Block a user