Skip to content

Commit a9f4b53

Browse files
committed
- fix tooltips
1 parent f6bd25c commit a9f4b53

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/com/osiris/desku/ui/UI.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ public static void remove(Thread... threads) {
148148
*/
149149
public abstract void plusY(int y) throws InterruptedException, InvocationTargetException;
150150

151+
/**
152+
* @see #executeJavaScriptSafely(String, String, int)
153+
*/
154+
public void executeJavaScriptSafely(String jsCode) {
155+
executeJavaScriptSafely(jsCode, "internal", 0);
156+
}
157+
151158
/**
152159
* Executes {@link #executeJavaScript(String, String, int)} only once the UI is loaded and after
153160
* some internals JS dependencies are loaded.

src/main/java/com/osiris/desku/ui/layout/Tooltip.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.osiris.desku.ui.layout;
22

33
import com.osiris.desku.ui.Component;
4+
import com.osiris.desku.ui.UI;
45

56
public class Tooltip{
67
public Component<?, ?> parent;
@@ -15,7 +16,8 @@ public Tooltip attachToParent(){
1516
parent.atr("data-bs-toggle", "tooltip");
1617
parent.atr("data-bs-title", content);
1718

18-
parent.executeJS("new bootstrap.Tooltip(comp)");
19+
UI ui = UI.get();
20+
ui.executeJavaScriptSafely(ui.jsGetComp("comp", parent.id) + "new bootstrap.Tooltip(comp)");
1921
return this;
2022
}
2123
}

0 commit comments

Comments
 (0)