diff options
author | fawn <fangrui_tong@brown.edu> | 2019-07-29 17:34:57 -0400 |
---|---|---|
committer | fawn <fangrui_tong@brown.edu> | 2019-07-29 17:34:57 -0400 |
commit | 1190dc51c66cb48d48c16988f14100fd9a7004e2 (patch) | |
tree | e633a1548d705851dca318d5c056e135a718c594 /src/new_fields/SchemaHeaderField.ts | |
parent | f1cb6a2212b11ba6d18dfa2e800b2c8e4ad94a88 (diff) |
color + type on schemaheaderfields fixed and schemas can toggle textwrapping
Diffstat (limited to 'src/new_fields/SchemaHeaderField.ts')
-rw-r--r-- | src/new_fields/SchemaHeaderField.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/new_fields/SchemaHeaderField.ts b/src/new_fields/SchemaHeaderField.ts index 475296d5c..9f716bf9f 100644 --- a/src/new_fields/SchemaHeaderField.ts +++ b/src/new_fields/SchemaHeaderField.ts @@ -6,7 +6,7 @@ import { scriptingGlobal, Scripting } from "../client/util/Scripting"; import { ColumnType } from "../client/views/collections/CollectionSchemaView"; export const PastelSchemaPalette = new Map<string, string>([ - ["pink1", "#FFB4E8"], + // ["pink1", "#FFB4E8"], ["pink2", "#ff9cee"], ["pink3", "#ffccf9"], ["pink4", "#fcc2ff"], @@ -32,7 +32,7 @@ export const PastelSchemaPalette = new Map<string, string>([ ["yellow2", "#e7ffac"], ["yellow3", "#ffffd1"], ["yellow4", "#fff5ba"], - ["red1", "#ffc9de"], + // ["red1", "#ffc9de"], ["red2", "#ffabab"], ["red3", "#ffbebc"], ["red4", "#ffcbc1"], @@ -45,15 +45,16 @@ export const RandomPastel = () => Array.from(PastelSchemaPalette.values())[Math. export class SchemaHeaderField extends ObjectField { @serializable(primitive()) heading: string; + @serializable(primitive()) color: string; + @serializable(primitive()) type: number; - constructor(heading: string = "", color: string, type?: ColumnType) { - console.log("CREATING SCHEMA HEADER FIELD"); + constructor(heading: string = "", color: string = RandomPastel(), type?: ColumnType) { super(); this.heading = heading; - this.color = color === undefined ? "#000" : color; + this.color = color; if (type) { this.type = type; } |