From 1e9cc8c53384364028b75441f2405d2153015668 Mon Sep 17 00:00:00 2001 From: Kirill Vasin Date: Fri, 2 Aug 2024 20:44:59 +0200 Subject: [PATCH] Update WebUI.wlx --- Kernel/WebUI.wlx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Kernel/WebUI.wlx b/Kernel/WebUI.wlx index 962aede..b3b6b1e 100644 --- a/Kernel/WebUI.wlx +++ b/Kernel/WebUI.wlx @@ -1,7 +1,7 @@ (* /* WLX Lazy loader */ *) (* /* holds expressions inside and loads by a signal via WebSockets */ *) -WebUILazyLoad[content_, OptionsPattern[]] := With[{event = EventClone[OptionValue["Event"]], uid = CreateUUID[]}, +WebUILazyLoad[content_, OptionsPattern[]] := With[{event = EventClone[OptionValue["Event"]], uid = CreateUUID[], tag = OptionValue["Tag"], class = OptionValue["Class"]}, EventHandler[event, { "Load" -> Function[data, @@ -34,11 +34,10 @@ WebUILazyLoad[content_, OptionsPattern[]] := With[{event = EventClone[OptionValu }]; - -
+ StringJoin["<", tag, " id=\"", uid, "\" class=\"", class, "\">", "<", "/", tag, ">"] ]; -Options[WebUILazyLoad] = {"Event" -> ""}; +Options[WebUILazyLoad] = {"Event" -> "", "Tag" -> "div", "Class" -> ""}; SetAttributes[WebUILazyLoad, HoldFirst];