From 9e6f81fdd224f5988ce3b8e794d630f81a34bc0b Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 30 Aug 2020 00:33:26 -0400 Subject: removed ComponentWillMount which is obsolete --- src/client/views/animationtimeline/Timeline.tsx | 5 +---- src/client/views/collections/CollectionSchemaHeaders.tsx | 12 ++++-------- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx index df828897e..1131ec874 100644 --- a/src/client/views/animationtimeline/Timeline.tsx +++ b/src/client/views/animationtimeline/Timeline.tsx @@ -83,14 +83,11 @@ export class Timeline extends React.Component { } /////////lifecycle functions//////////// - componentWillMount() { + componentDidMount() { const relativeHeight = window.innerHeight / 20; //sets height to arbitrary size, relative to innerHeight this._titleHeight = relativeHeight < this.MAX_TITLE_HEIGHT ? relativeHeight : this.MAX_TITLE_HEIGHT; //check if relHeight is less than Maxheight. Else, just set relheight to max this.MIN_CONTAINER_HEIGHT = this._titleHeight + 130; //offset this.DEFAULT_CONTAINER_HEIGHT = this._titleHeight * 2 + 130; //twice the titleheight + offset - } - - componentDidMount() { runInAction(() => { if (!this.props.Document.AnimationLength) { //if animation length did not exist this.props.Document.AnimationLength = this._time; //set it to default time diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx index b2fdf376d..cecee1de3 100644 --- a/src/client/views/collections/CollectionSchemaHeaders.tsx +++ b/src/client/views/collections/CollectionSchemaHeaders.tsx @@ -260,6 +260,10 @@ export class KeysDropdown extends React.Component { componentDidMount() { document.addEventListener("pointerdown", this.detectClick); + const filters = Cast(this.props.Document._docFilters, listSpec("string")); + if (filters?.includes(this._key)) { + runInAction(() => this.closeResultsVisibility = "contents"); + } } @action @@ -271,14 +275,6 @@ export class KeysDropdown extends React.Component { } } - componentWillMount() { - document.removeEventListener("pointerdown", this.detectClick); - const filters = Cast(this.props.Document._docFilters, listSpec("string")); - if (filters?.includes(this._key)) { - runInAction(() => this.closeResultsVisibility = "contents"); - } - } - private tempfilter: string = ""; @undoBatch onKeyDown = (e: React.KeyboardEvent): void => { -- cgit v1.2.3-70-g09d2