aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionCarousel3DView.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-02-25 15:36:49 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-02-25 15:36:49 -0500
commit95451a2eb0871856b946fff8a14ca0c385af5f1b (patch)
tree90c18c68c4e077d63dd3286d527b243ac6cdc501 /src/client/views/collections/CollectionCarousel3DView.tsx
parent02bceed486ecb03b94c757ae669f69912f282cdd (diff)
parent17ee7f6f1f61a079ec79b71aebc65abfd72ec32a (diff)
merging
Diffstat (limited to 'src/client/views/collections/CollectionCarousel3DView.tsx')
-rw-r--r--src/client/views/collections/CollectionCarousel3DView.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionCarousel3DView.tsx b/src/client/views/collections/CollectionCarousel3DView.tsx
index 9b1e3b80d..c5a05da00 100644
--- a/src/client/views/collections/CollectionCarousel3DView.tsx
+++ b/src/client/views/collections/CollectionCarousel3DView.tsx
@@ -40,7 +40,7 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
@computed get content() {
const currentIndex = NumCast(this.layoutDoc._itemIndex);
const displayDoc = (childPair: { layout: Doc, data: Doc }) => {
- const script = ScriptField.MakeScript("child._showCaption = 'caption'", { child: Doc.name }, { child: childPair.layout });
+ const script = ScriptField.MakeScript("this._showCaption = 'caption'", { this: Doc.name });
const onChildClick = script && (() => script);
return <DocumentView {...OmitKeys(this.props, ["NativeWidth", "NativeHeight"]).omit}
onDoubleClick={this.onChildDoubleClick}
@@ -63,8 +63,8 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
<div key={childPair.layout[Id]}
className={`collectionCarousel3DView-item${index === currentIndex ? "-active" : ""} ${index}`}
style={index === currentIndex ?
- { opacity: '1', transform: 'scale(1.3)' } :
- { opacity: '0.5', transform: 'scale(0.6)', userSelect: 'none' }}>
+ { opacity: '1', transform: 'scale(1.3)', width: this.panelWidth() } :
+ { opacity: '0.5', transform: 'scale(0.6)', userSelect: 'none', width: this.panelWidth() }}>
{displayDoc(childPair)}
</div>);
}));
@@ -166,10 +166,10 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
render() {
const index = NumCast(this.layoutDoc._itemIndex);
- const translateX = 33 * (1 - index);
+ const translateX = this.panelWidth() * (1 - index);
return <div className="collectionCarousel3DView-outer" onClick={this.onClick} onPointerDown={this.onPointerDown} ref={this.createDashEventsTarget}>
- <div className="carousel-wrapper" style={{ transform: `translateX(calc(${translateX}%` }}>
+ <div className="carousel-wrapper" style={{ transform: `translateX(${translateX}px)` }}>
{this.content}
</div>
{this.props.Document._chromeStatus !== "replaced" ? this.buttons : (null)}