aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionLinear
diff options
context:
space:
mode:
authorJoanne <zehan_ding@brown.edu>2025-05-12 21:00:38 -0400
committerJoanne <zehan_ding@brown.edu>2025-05-12 21:00:38 -0400
commit430db63077868fa54829721d6530a810aa4d4588 (patch)
tree4b1ac30d8f5d90ba4b9d5e45414e6222d3af0e09 /src/client/views/collections/collectionLinear
parentcd93c88b8fee83a99342eac4dc60f7b4373fa843 (diff)
parent0c3f86d57225a2991920adef3a337bc13e408ac0 (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web into joanne-tutorialagent
Diffstat (limited to 'src/client/views/collections/collectionLinear')
-rw-r--r--src/client/views/collections/collectionLinear/CollectionLinearView.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx
index 3c2a99b1e..d0a1e6f0d 100644
--- a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx
+++ b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx
@@ -27,7 +27,7 @@ import './CollectionLinearView.scss';
/**
* CollectionLinearView is the class for rendering the horizontal collection
* of documents, it useful for horizontal menus. It can either be expandable
- * or not using the linearView_Expandable field.
+ * or not using the linearView_expandable field.
* It is used in the following locations:
* - It is used in the popup menu on the bottom left (see docButtons() in MainView.tsx)
* - It is used for the context sensitive toolbar at the top (see contMenuButtons() in CollectionMenu.tsx)
@@ -52,7 +52,7 @@ export class CollectionLinearView extends CollectionSubView() {
componentDidMount() {
this._widthDisposer = reaction(
- () => 5 + NumCast(this.dataDoc.linearBtnWidth, this.dimension()) + (this.layoutDoc.linearView_IsOpen ? this.childDocs.filter(doc => !doc.hidden).reduce((tot, doc) => (NumCast(doc._width) || this.dimension()) + tot + 4, 0) : 0),
+ () => 5 + NumCast(this.dataDoc.linearView_btnWidth, this.dimension()) + (this.layoutDoc.linearView_isOpen ? this.childDocs.filter(doc => !doc.hidden).reduce((tot, doc) => (NumCast(doc._width) || this.dimension()) + tot + 4, 0) : 0),
width => {
this.childDocs.length && (this.layoutDoc._width = width);
},
@@ -208,7 +208,7 @@ export class CollectionLinearView extends CollectionSubView() {
render() {
const flexDir = StrCast(this.Document.flexDirection); // Specify direction of linear view content
const flexGap = NumCast(this.Document.flexGap); // Specify the gap between linear view content
- const isExpanded = BoolCast(this.layoutDoc.linearView_IsOpen);
+ const isExpanded = BoolCast(this.layoutDoc.linearView_isOpen);
const menuOpener = (
<Toggle
@@ -219,9 +219,9 @@ export class CollectionLinearView extends CollectionSubView() {
type={Type.TERT}
onPointerDown={e => e.stopPropagation()}
toggleType={ToggleType.BUTTON}
- toggleStatus={BoolCast(this.layoutDoc.linearView_IsOpen)}
+ toggleStatus={BoolCast(this.layoutDoc.linearView_isOpen)}
onClick={() => {
- this.layoutDoc.linearView_IsOpen = !isExpanded;
+ this.layoutDoc.linearView_isOpen = !isExpanded;
ScriptCast(this.Document.onClick)?.script.run({ this: this.Document }, console.log);
}}
tooltip={isExpanded ? 'Close' : 'Open'}
@@ -231,10 +231,10 @@ export class CollectionLinearView extends CollectionSubView() {
);
return (
- <div className={`collectionLinearView-outer ${this.layoutDoc.linearView_SubMenu}`} style={{ backgroundColor: this.layoutDoc.linearView_IsOpen ? undefined : 'transparent' }}>
+ <div className="collectionLinearView-outer" style={{ backgroundColor: this.layoutDoc.linearView_isOpen ? undefined : 'transparent' }}>
<div className="collectionLinearView" ref={this.createDashEventsTarget} onContextMenu={this.myContextMenu} style={{ minHeight: this.dimension(), pointerEvents: 'all' }}>
- {!this.layoutDoc.linearView_Expandable ? null : menuOpener}
- {!this.layoutDoc.linearView_IsOpen ? null : (
+ {!this.layoutDoc.linearView_expandable ? null : menuOpener}
+ {!this.layoutDoc.linearView_isOpen && this.layoutDoc.linearView_expandable ? null : (
<div
className="collectionLinearView-content"
style={{