From fa90ff5befe994d08205ea774a6353fec9ed0632 Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 28 Mar 2018 12:33:31 -0700 Subject: [PATCH] make extra parameters collapsible to make more space for tags --- css/base.css | 8 +++- index.html | 132 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 92 insertions(+), 48 deletions(-) diff --git a/css/base.css b/css/base.css index 1abaf048..aa88fe9f 100644 --- a/css/base.css +++ b/css/base.css @@ -765,13 +765,17 @@ table.permission-editor td.checkbox { padding: 0.5rem 0.75rem; line-height: 1.5; } + /* Make sure padding is only applied at the top level panel */ -.panel-form-row > .panel-form-column { +.panel-form-row > .panel-form-column, +.panel-form-column > .panel-form-column { padding: 0!important; flex-grow: 1; } -.panel-form-column > .panel-form-row { +.panel-form-column > .panel-form-row, +.panel-form-row > .panel-form-row + { padding: 0!important; } diff --git a/index.html b/index.html index b834e70e..2aac0b98 100644 --- a/index.html +++ b/index.html @@ -528,6 +528,33 @@ } } + // Toggle [Title text >] -> [Title text v] + class MoreButton extends React.PureComponent { + constructor(props) { + super(props); + + this.state = { + open: this.props.open + }; + this.handleToggle = this.handleToggle.bind(this); + } + + handleToggle() { + var open = !this.state.open; + this.setState({open: open}); + if (this.props.onToggle) { + this.props.onToggle(open); + } + } + + render() { + return (); + } + } + /* BEGIN Lettertile: Avatar box: either a bitmap or a letter tile or a stock icon. */ class LetterTile extends React.PureComponent { render() { @@ -2343,7 +2370,8 @@ anon: null, contactList: [], showMemberPanel: this.props.showMemberPanel, - showPermissionEditorFor: undefined + showPermissionEditorFor: undefined, + moreInfoExpanded: false }; }, @@ -2585,7 +2613,9 @@ handleMemberSelected: function(uid) { this.setState({selectedContact: uid}); }, - + handleMoreInfo: function(open) { + this.setState({moreInfoExpanded: open}); + }, handleContextMenu: function(params) { var instance = this; var topic = Tinode.getTopic(this.props.topic); @@ -2674,65 +2704,75 @@
-
- - {this.state.address} -
- {this.state.groupTopic ? + + {this.state.moreInfoExpanded ? +
- - - {this.state.access} - + + {this.state.address}
- : -
-
-
-
Yours:   + + {this.state.access} -
-
{this.state.fullName}′s:   - {this.state.modeGiven2} -
+
-
- } - {this.state.sharer && (this.state.auth || this.state.anon) ? -
-
-
-
Auth: {this.state.admin ? - - {this.state.auth} - - : - {this.state.auth} - } -
-
Anon: {this.state.admin ? - - {this.state.anon} - - : - {this.state.anon} - } + : +
+
+
+
Yours:   + {this.state.access} +
+
{this.state.fullName}′s:   + {this.state.modeGiven2} +
+ } + {this.state.sharer && (this.state.auth || this.state.anon) ? +
+
+
+
Auth: {this.state.admin ? + + {this.state.auth} + + : + {this.state.auth} + } +
+
Anon: {this.state.admin ? + + {this.state.anon} + + : + {this.state.anon} + } +
+
+
+ : + null + }
: null - } + }
{this.state.groupTopic ?