aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/SchemaHeaderField.ts
diff options
context:
space:
mode:
authorfawn <fangrui_tong@brown.edu>2019-07-29 17:34:57 -0400
committerfawn <fangrui_tong@brown.edu>2019-07-29 17:34:57 -0400
commit1190dc51c66cb48d48c16988f14100fd9a7004e2 (patch)
treee633a1548d705851dca318d5c056e135a718c594 /src/new_fields/SchemaHeaderField.ts
parentf1cb6a2212b11ba6d18dfa2e800b2c8e4ad94a88 (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.ts11
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;
}