Fixes
This commit is contained in:
@@ -90,7 +90,7 @@ export class AppState {
|
||||
createEditor(title?: string) {
|
||||
const activeEditor = this.getActiveEditor();
|
||||
if (!activeEditor || this.multiEditorEnabled) {
|
||||
this.application.editorGroup.createEditor(title);
|
||||
this.application.editorGroup.createEditor(undefined, title);
|
||||
} else {
|
||||
activeEditor.reset(title);
|
||||
}
|
||||
|
||||
@@ -100,48 +100,39 @@ export class WebApplication extends SNApplication {
|
||||
this.webServices = services;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getAppState() {
|
||||
public getAppState() {
|
||||
return this.webServices.appState;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getDesktopService() {
|
||||
public getDesktopService() {
|
||||
return this.webServices.desktopService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getLockService() {
|
||||
public getLockService() {
|
||||
return this.webServices.lockService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getArchiveService() {
|
||||
public getArchiveService() {
|
||||
return this.webServices.archiveService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getNativeExtService() {
|
||||
public getNativeExtService() {
|
||||
return this.webServices.nativeExtService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getStatusService() {
|
||||
public getStatusService() {
|
||||
return this.webServices.statusService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getThemeService() {
|
||||
public getThemeService() {
|
||||
return this.webServices.themeService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getPrefsService() {
|
||||
public getPrefsService() {
|
||||
return this.webServices.prefsService;
|
||||
}
|
||||
|
||||
/** @access public */
|
||||
getKeyboardService() {
|
||||
public getKeyboardService() {
|
||||
return this.webServices.keyboardService;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
application='self.application'
|
||||
)
|
||||
input.tags-input(
|
||||
ng-blur='self.saveTagsFromStrings()',
|
||||
ng-blur='self.onTagsInputBlur()',
|
||||
ng-disabled='self.noteLocked',
|
||||
ng-if='!(self.state.tagsComponent && self.state.tagsComponent.active)',
|
||||
ng-keyup='$event.keyCode == 13 && $event.target.blur();',
|
||||
|
||||
@@ -447,7 +447,6 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope {
|
||||
return;
|
||||
}
|
||||
if (this.editor.isTemplateNote) {
|
||||
console.log("is template");
|
||||
await this.editor.insertTemplatedNote();
|
||||
if (this.appState.selectedTag) {
|
||||
await this.application.changeItem(
|
||||
@@ -793,6 +792,11 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope {
|
||||
this.saveTagsFromStrings(strings);
|
||||
}
|
||||
|
||||
onTagsInputBlur() {
|
||||
this.saveTagsFromStrings();
|
||||
this.focusEditor();
|
||||
}
|
||||
|
||||
public async saveTagsFromStrings(strings?: string[]) {
|
||||
if (
|
||||
!strings
|
||||
|
||||
@@ -167,21 +167,19 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
* Access the current state notes without awaiting any potential reloads
|
||||
* that may be in progress. This is the sync alternative to `async getMostValidNotes`
|
||||
*/
|
||||
getPossiblyStaleNotes() {
|
||||
private getPossiblyStaleNotes() {
|
||||
return this.getState().notes!;
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
* Access the current state notes after waiting for any pending reloads.
|
||||
* This returns the most up to date notes, but is the asyncronous counterpart
|
||||
* to `getPossiblyStaleNotes`
|
||||
*/
|
||||
async getMostValidNotes() {
|
||||
private async getMostValidNotes() {
|
||||
await this.reloadNotesPromise;
|
||||
return this.getPossiblyStaleNotes();
|
||||
}
|
||||
@@ -190,9 +188,8 @@ class NotesViewCtrl extends PureViewCtrl {
|
||||
* Triggered programatically to create a new placeholder note
|
||||
* when conditions allow for it. This is as opposed to creating a new note
|
||||
* as part of user interaction (pressing the + button).
|
||||
* @access private
|
||||
*/
|
||||
async createPlaceholderNote() {
|
||||
private async createPlaceholderNote() {
|
||||
const selectedTag = this.application!.getAppState().getSelectedTag()!;
|
||||
if (selectedTag.isSmartTag() && !selectedTag.isAllTag) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user