Add clickable style only when the item does something on click.

This commit is contained in:
kovacsv 2021-10-28 17:07:52 +02:00
parent 0fba20ded8
commit b63a94db11

View File

@ -47,6 +47,7 @@ OV.TreeViewItem = class
OnClick (onClick) OnClick (onClick)
{ {
this.mainElement.addClass ('clickable');
this.mainElement.css ('cursor', 'pointer'); this.mainElement.css ('cursor', 'pointer');
this.mainElement.click (onClick); this.mainElement.click (onClick);
} }
@ -93,7 +94,6 @@ OV.TreeViewButtonItem = class extends OV.TreeViewSingleItem
constructor (name) constructor (name)
{ {
super (name); super (name);
this.mainElement.addClass ('clickable');
this.buttonsDiv = $('<div>').addClass ('ov_tree_item_button_container').insertBefore (this.nameElement); this.buttonsDiv = $('<div>').addClass ('ov_tree_item_button_container').insertBefore (this.nameElement);
} }
@ -139,7 +139,6 @@ OV.TreeViewGroupItem = class extends OV.TreeViewItem
{ {
if (this.childrenDiv === null) { if (this.childrenDiv === null) {
this.childrenDiv = $('<div>').addClass ('ov_tree_view_children').insertAfter (this.mainElement); this.childrenDiv = $('<div>').addClass ('ov_tree_view_children').insertAfter (this.mainElement);
this.mainElement.addClass ('clickable');
this.ShowChildren (this.showChildren, null); this.ShowChildren (this.showChildren, null);
this.OnClick ((ev) => { this.OnClick ((ev) => {
this.showChildren = !this.showChildren; this.showChildren = !this.showChildren;