Skip to content

Commit

Permalink
reenable wrap_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Sep 30, 2024
1 parent 3f7ac55 commit 615da57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions datex-bindings/dom-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,12 @@ export class DOMUtils {
let newNode: any;

// is function

// collapse pointer if function
if (value instanceof Datex.ReactiveValue && typeof value.val == "function") {
value = value.val;
}

if (typeof value == "function") {
if (client_type == "deno") {
newNode = document.createElement("uix-placeholder");
Expand Down
10 changes: 5 additions & 5 deletions datex-bindings/transform-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function appendToFragment(domUtils: DOMUtils, context: DOMContext, fragment: HTM
export function getTransformWrapper(domUtils: DOMUtils, context: DOMContext) {
return {
// special uix-fragment wrapper for transforms
// wrap_transform(val:any) {
// const fragment = context.document.createElement("uix-fragment");
// appendToFragment(domUtils, context, fragment, val);
// return fragment;
// },
wrap_transform(val:any) {
const fragment = context.document.createElement("uix-fragment");
appendToFragment(domUtils, context, fragment, val);
return fragment;
},

allow_transform_value(type: Datex.Type) {
return allDomTypes.has(type.root_type) || type.root_type.name == "uix" || "must be a DOM element"
Expand Down

0 comments on commit 615da57

Please sign in to comment.