aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-02 19:52:59 -0500
committerbobzel <zzzman@gmail.com>2021-03-02 19:52:59 -0500
commit1b481cd441cc8bb200906b246b43e4bc5dc53b4e (patch)
tree10fe0b4cbbfa7a0c25cf84090aef0f12bbf0be4c /src/fields
parentfaf9dc5ca6a7380f3b040dc2ddbe07c29689e014 (diff)
added a fitwidth toggle for lightbox. fixed _showCaption/setting _fields to undefined. updated documentView to use not having fitWidth set as a trigger for whether to treat a doc without nativeWidth/Height as if its width/height is that.
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Schema.ts5
-rw-r--r--src/fields/util.ts2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/fields/Schema.ts b/src/fields/Schema.ts
index 4607e0fd5..78f8a6bfb 100644
--- a/src/fields/Schema.ts
+++ b/src/fields/Schema.ts
@@ -3,6 +3,7 @@ import { Doc, Field } from "./Doc";
import { ObjectField } from "./ObjectField";
import { RefField } from "./RefField";
import { SelfProxy } from "./FieldSymbols";
+import { List } from "./List";
type AllToInterface<T extends Interface[]> = {
1: ToInterface<Head<T>> & AllToInterface<Tail<T>>,
@@ -67,9 +68,9 @@ export function makeInterface<T extends Interface[]>(...schemas: T): InterfaceFu
return function (doc?: Doc | Doc[]) {
if (doc instanceof Doc || doc === undefined) {
return fn(doc || new Doc);
- } else {
+ } else if (doc instanceof List) {
return doc.map(fn);
- }
+ } else return {};
};
}
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 7955fc9fb..36c765dd0 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -289,7 +289,7 @@ export function setter(target: any, in_prop: string | symbol | number, value: an
// console.log(prop + " is deprecated - switch to _" + prop);
// prop = "_" + prop;
// }
- if (!prop.startsWith("__") && value !== undefined) prop = prop.substring(1);
+ if (!prop.startsWith("__")) prop = prop.substring(1);
if (target.__LAYOUT__) {
target.__LAYOUT__[prop] = value;
return true;