aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionViewChromes.tsx
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-06-30 03:29:27 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-06-30 03:29:27 +0800
commit73bbc602fb964c82999faccfdde8eeca6fbf08c4 (patch)
tree576b41e77fd3280ee282e3ece6effbca39f57901 /src/client/views/collections/CollectionViewChromes.tsx
parent6b75f84565a5019175b16ee5ea69fc5330aa2c0d (diff)
parentcb8b5b3d9e735c88b9efdd9b4a444cac40fdedb2 (diff)
Merge branch 'master' into mobile_revision_direct
Diffstat (limited to 'src/client/views/collections/CollectionViewChromes.tsx')
-rw-r--r--src/client/views/collections/CollectionViewChromes.tsx49
1 files changed, 46 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionViewChromes.tsx b/src/client/views/collections/CollectionViewChromes.tsx
index d293a1fb1..da3194940 100644
--- a/src/client/views/collections/CollectionViewChromes.tsx
+++ b/src/client/views/collections/CollectionViewChromes.tsx
@@ -88,6 +88,7 @@ export class CollectionViewBaseChrome extends React.Component<CollectionViewChro
case CollectionViewType.Freeform: return this._freeform_commands;
case CollectionViewType.Time: return this._freeform_commands;
case CollectionViewType.Carousel: return this._freeform_commands;
+ case CollectionViewType.Carousel3D: return this._freeform_commands;
}
return [];
}
@@ -214,6 +215,7 @@ export class CollectionViewBaseChrome extends React.Component<CollectionViewChro
case CollectionViewType.Schema: return (<CollectionSchemaViewChrome key="collchrome" PanelWidth={this.props.PanelWidth} CollectionView={this.props.CollectionView} type={this.props.type} />);
case CollectionViewType.Tree: return (<CollectionTreeViewChrome key="collchrome" PanelWidth={this.props.PanelWidth} CollectionView={this.props.CollectionView} type={this.props.type} />);
case CollectionViewType.Masonry: return (<CollectionStackingViewChrome key="collchrome" PanelWidth={this.props.PanelWidth} CollectionView={this.props.CollectionView} type={this.props.type} />);
+ case CollectionViewType.Carousel3D: return (<Collection3DCarouselViewChrome key="collchrome" PanelWidth={this.props.PanelWidth} CollectionView={this.props.CollectionView} type={this.props.type} />);
case CollectionViewType.Grid: return (<CollectionGridViewChrome key="collchrome" PanelWidth={this.props.PanelWidth} CollectionView={this.props.CollectionView} type={this.props.type} />);
default: return null;
}
@@ -404,7 +406,7 @@ export class CollectionStackingViewChrome extends React.Component<CollectionView
@observable private _currentKey: string = "";
@observable private suggestions: string[] = [];
- @computed private get descending() { return BoolCast(this.props.CollectionView.props.Document.stackingHeadersSortDescending); }
+ @computed private get descending() { return StrCast(this.props.CollectionView.props.Document._columnsSort) === "descending"; }
@computed get pivotField() { return StrCast(this.props.CollectionView.props.Document._pivotField); }
getKeySuggestions = async (value: string): Promise<string[]> => {
@@ -448,7 +450,11 @@ export class CollectionStackingViewChrome extends React.Component<CollectionView
return true;
}
- @action toggleSort = () => { this.props.CollectionView.props.Document.stackingHeadersSortDescending = !this.props.CollectionView.props.Document.stackingHeadersSortDescending; };
+ @action toggleSort = () => {
+ this.props.CollectionView.props.Document._columnsSort =
+ this.props.CollectionView.props.Document._columnsSort === "descending" ? "ascending" :
+ this.props.CollectionView.props.Document._columnsSort === "ascending" ? undefined : "descending";
+ };
@action resetValue = () => { this._currentKey = this.pivotField; };
render() {
@@ -577,6 +583,43 @@ export class CollectionTreeViewChrome extends React.Component<CollectionViewChro
}
}
+// Enter scroll speed for 3D Carousel
+@observer
+export class Collection3DCarouselViewChrome extends React.Component<CollectionViewChromeProps> {
+ @computed get scrollSpeed() {
+ return this.props.CollectionView.props.Document._autoScrollSpeed;
+ }
+
+ @action
+ setValue = (value: string) => {
+ const numValue = Number(StrCast(value));
+ if (numValue > 0) {
+ this.props.CollectionView.props.Document._autoScrollSpeed = numValue;
+ return true;
+ }
+ return false;
+ }
+
+ render() {
+ return (
+ <div className="collection3DCarouselViewChrome-cont">
+ <div className="collection3DCarouselViewChrome-scrollSpeed-cont">
+ <div className="collectionStackingViewChrome-scrollSpeed-label">
+ AUTOSCROLL SPEED:
+ </div>
+ <div className="collection3DCarouselViewChrome-scrollSpeed">
+ <EditableView
+ GetValue={() => StrCast(this.scrollSpeed)}
+ oneLine
+ SetValue={this.setValue}
+ contents={this.scrollSpeed ? this.scrollSpeed : 1000} />
+ </div>
+ </div>
+ </div>
+ );
+ }
+}
+
/**
* Chrome for grid view.
*/
@@ -754,4 +797,4 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewChro
</div>
);
}
-} \ No newline at end of file
+}