diff options
author | bobzel <zzzman@gmail.com> | 2023-12-29 17:01:40 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-29 17:01:40 -0500 |
commit | 9b9f54a43793ca6ffb26c56f962d11ba8325abd2 (patch) | |
tree | 026063b95da59556eb0a416b5f6fafd2ebccd737 /src/client/views/UndoStack.tsx | |
parent | a567eb1b6469db202d41d4d54f2c96137e49ea9c (diff) |
cleaned up imports, mobx observable initialization and some compile errors.
Diffstat (limited to 'src/client/views/UndoStack.tsx')
-rw-r--r-- | src/client/views/UndoStack.tsx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/client/views/UndoStack.tsx b/src/client/views/UndoStack.tsx index f07e38af1..ea038250e 100644 --- a/src/client/views/UndoStack.tsx +++ b/src/client/views/UndoStack.tsx @@ -15,8 +15,8 @@ interface UndoStackProps { } @observer export class UndoStack extends React.Component<UndoStackProps> { - @observable static HideInline: boolean; - @observable static Expand: boolean; + @observable static HideInline: boolean = false; + @observable static Expand: boolean = false; render() { const background = UndoManager.batchCounter.get() ? 'yellow' : SettingsManager.userVariantColor; const color = UndoManager.batchCounter.get() ? 'black' : SettingsManager.userColor; @@ -39,19 +39,25 @@ export class UndoStack extends React.Component<UndoStackProps> { color, }}> {Array.from(UndoManager.undoStackNames).map((name, i) => ( - <div className="undoStack-resultContainer" key={i} - onClick={e => { + <div + className="undoStack-resultContainer" + key={i} + onClick={e => { const size = UndoManager.undoStackNames.length; - for (let n = 0; n < size-i; n++ ) UndoManager.Undo(); } } - > + for (let n = 0; n < size - i; n++) UndoManager.Undo(); + }}> <div className="undoStack-commandString">{StrCast(name).replace(/[^\.]*\./, '')}</div> </div> ))} {Array.from(UndoManager.redoStackNames) .reverse() .map((name, i) => ( - <div className="undoStack-resultContainer" key={i} onClick={e => - { for (let n = 0; n <= i; n++ ) UndoManager.Redo() }}> + <div + className="undoStack-resultContainer" + key={i} + onClick={e => { + for (let n = 0; n <= i; n++) UndoManager.Redo(); + }}> <div className="undoStack-commandString" style={{ fontWeight: 'bold', background: SettingsManager.userBackgroundColor, color: SettingsManager.userColor }}> {StrCast(name).replace(/[^\.]*\./, '')} </div> |