Skip to content

Commit

Permalink
Update WebUI.wlx
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryI authored Aug 2, 2024
1 parent 98580cf commit 1e9cc8c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Kernel/WebUI.wlx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -34,11 +34,10 @@ WebUILazyLoad[content_, OptionsPattern[]] := With[{event = EventClone[OptionValu

}];


<div id="{uid}"></div>
StringJoin["<", tag, " id=\"", uid, "\" class=\"", class, "\">", "<", "/", tag, ">"]
];

Options[WebUILazyLoad] = {"Event" -> ""};
Options[WebUILazyLoad] = {"Event" -> "", "Tag" -> "div", "Class" -> ""};

SetAttributes[WebUILazyLoad, HoldFirst];

Expand Down

0 comments on commit 1e9cc8c

Please sign in to comment.