fix: proper names for actions and history menus (#450)

Co-authored-by: Johnny Almonte <johnny243@users.noreply.github.com>
This commit is contained in:
Johnny A
2020-08-21 22:57:23 -04:00
committed by GitHub
parent 3679fc0eca
commit d96b058133
2 changed files with 18 additions and 17 deletions

View File

@@ -171,26 +171,27 @@
application='self.application' application='self.application'
) )
.sk-app-bar-item( .sk-app-bar-item(
click-outside=`self.setMenuState('showExtensions', false)`, click-outside=`self.setMenuState('showActionsMenu', false)`,
is-open='self.state.showExtensions', is-open='self.state.showActionsMenu',
ng-class="{'selected' : self.state.showExtensions}", ng-class="{'selected' : self.state.showActionsMenu}",
ng-click="self.toggleMenu('showExtensions')" ng-click="self.toggleMenu('showActionsMenu')"
) )
.sk-label Actions .sk-label Actions
actions-menu( actions-menu(
item='self.note', item='self.note',
ng-if='self.state.showExtensions', ng-if='self.state.showActionsMenu',
application='self.application' application='self.application'
) )
.sk-app-bar-item( .sk-app-bar-item(
click-outside=`self.setMenuState('showHistory', false)`, click-outside=`self.setMenuState('showHistoryMenu', false)`,
is-open='self.state.showHistory', is-open='self.state.showHistoryMenu',
ng-click="self.toggleMenu('showHistory')" ng-class="{'selected' : self.state.showHistoryMenu}",
ng-click="self.toggleMenu('showHistoryMenu')"
) )
.sk-label History .sk-label History
history-menu( history-menu(
item='self.note', item='self.note',
ng-if='self.state.showHistory', ng-if='self.state.showHistoryMenu',
application='self.application' application='self.application'
) )
#editor-content.editor-content(ng-if='!self.note.errorDecrypting') #editor-content.editor-content(ng-if='!self.note.errorDecrypting')

View File

@@ -68,10 +68,10 @@ type EditorState = {
monospaceFont?: boolean monospaceFont?: boolean
isDesktop?: boolean isDesktop?: boolean
syncTakingTooLong: boolean syncTakingTooLong: boolean
showExtensions: boolean showActionsMenu: boolean
showOptionsMenu: boolean showOptionsMenu: boolean
showEditorMenu: boolean showEditorMenu: boolean
showSessionHistory: boolean showHistoryMenu: boolean
altKeyDown: boolean altKeyDown: boolean
spellcheck: boolean spellcheck: boolean
/** /**
@@ -217,10 +217,10 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
isDesktop: isDesktopApplication(), isDesktop: isDesktopApplication(),
spellcheck: true, spellcheck: true,
syncTakingTooLong: false, syncTakingTooLong: false,
showExtensions: false, showActionsMenu: false,
showOptionsMenu: false, showOptionsMenu: false,
showEditorMenu: false, showEditorMenu: false,
showSessionHistory: false, showHistoryMenu: false,
altKeyDown: false, altKeyDown: false,
noteStatus: undefined, noteStatus: undefined,
editorUnloading: false, editorUnloading: false,
@@ -275,10 +275,10 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
async handleEditorNoteChange() { async handleEditorNoteChange() {
this.cancelPendingSetStatus(); this.cancelPendingSetStatus();
await this.setState({ await this.setState({
showExtensions: false, showActionsMenu: false,
showOptionsMenu: false, showOptionsMenu: false,
showEditorMenu: false, showEditorMenu: false,
showSessionHistory: false, showHistoryMenu: false,
altKeyDown: false, altKeyDown: false,
noteStatus: undefined noteStatus: undefined
}); });
@@ -383,8 +383,8 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
const allMenus = [ const allMenus = [
'showOptionsMenu', 'showOptionsMenu',
'showEditorMenu', 'showEditorMenu',
'showExtensions', 'showActionsMenu',
'showHistory', 'showHistoryMenu',
]; ];
const menuState: any = {}; const menuState: any = {};
for (const candidate of allMenus) { for (const candidate of allMenus) {