From b855c547fba01106a4a8c3699fd451bdfcadcf8d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 10 Dec 2017 18:25:44 +0100 Subject: make tables scrollable when they would overflow, make long keys expandable --- src/webex/pages/tree.tsx | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) (limited to 'src/webex/pages/tree.tsx') diff --git a/src/webex/pages/tree.tsx b/src/webex/pages/tree.tsx index 072150312..c8035c597 100644 --- a/src/webex/pages/tree.tsx +++ b/src/webex/pages/tree.tsx @@ -42,7 +42,7 @@ import { refresh, } from "../wxApi"; -import { renderAmount } from "../renderHtml"; +import { ExpanderText, renderAmount } from "../renderHtml"; import * as React from "react"; import * as ReactDOM from "react-dom"; @@ -244,49 +244,6 @@ interface DenominationListProps { exchange: ExchangeRecord; } -interface ExpanderTextProps { - text: string; -} - -class ExpanderText extends ImplicitStateComponent { - private expanded = this.makeState(false); - private textArea: any = undefined; - - componentDidUpdate() { - if (this.expanded() && this.textArea) { - this.textArea.focus(); - this.textArea.scrollTop = 0; - } - } - - render(): JSX.Element { - if (!this.expanded()) { - return ( - { this.expanded(true); }}> - {(this.props.text.length <= 10) - ? this.props.text - : ( - - {this.props.text.substring(0, 10)} - ... - - ) - } - - ); - } - return ( - - ); - } -} - class DenominationList extends ImplicitStateComponent { private expanded = this.makeState(false); private denoms = this.makeState(undefined); -- cgit v1.2.3