Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions public/cui.js
Original file line number Diff line number Diff line change
Expand Up @@ -50533,6 +50533,9 @@ CUI.ItemList = (function(superClass) {
if (item.hasLeft()) {
list_has_button_left = true;
}
if (item.__tooltipOpts && (!item.__tooltipOpts.placement || !item.__tooltipOpts.placements)) {
item.__tooltipOpts.placements = ["w", "e"];
}
}
if (item instanceof CUI.Button || item instanceof CUI.DataField || item instanceof CUI.Label) {
_this.__body.append(item);
Expand Down Expand Up @@ -50575,6 +50578,12 @@ CUI.ItemList = (function(superClass) {
if (menu) {
opts.menu_parent = menu;
}
if (!opts.tooltip) {
opts.tooltip = {};
}
if (!opts.tooltip.placement || !opts.tooltip.placements) {
opts.tooltip.placements = ["w", "e"];
}
btn = new CUI.defaults["class"].Button(opts);
listenButtonClick(btn);
if (btn.hasLeft()) {
Expand Down
2 changes: 1 addition & 1 deletion public/cui.min.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/elements/ItemList/ItemList.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ class CUI.ItemList extends CUI.VerticalLayout
if item.hasLeft()
list_has_button_left = true

if item.__tooltipOpts and (not item.__tooltipOpts.placement or not item.__tooltipOpts.placements)
item.__tooltipOpts.placements = ["w", "e"]

if item instanceof CUI.Button or
item instanceof CUI.DataField or
item instanceof CUI.Label
Expand Down Expand Up @@ -262,6 +265,12 @@ class CUI.ItemList extends CUI.VerticalLayout
if menu
opts.menu_parent = menu

if not opts.tooltip
opts.tooltip = {}

if not opts.tooltip.placement or not opts.tooltip.placements
opts.tooltip.placements = ["w", "e"]

btn = new CUI.defaults.class.Button(opts)

listenButtonClick(btn)
Expand Down Expand Up @@ -427,4 +436,4 @@ class CUI.ItemList extends CUI.VerticalLayout
CUI.ready =>
CUI.Events.registerEvent
type: "item-list-keydown"
sink: true
sink: true