feat: Replaced margin resizers with "Editor width" options. You can set it globally from Preferences > Appearance or per-note from the note options menu (#2324)
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
InternalEventBus,
|
||||
PrefKey,
|
||||
ApplicationEvent,
|
||||
EditorLineWidth,
|
||||
} from '@standardnotes/snjs'
|
||||
import { makeObservable, observable, action, computed, runInAction } from 'mobx'
|
||||
import { WebApplication } from '../../Application/WebApplication'
|
||||
@@ -358,6 +359,23 @@ export class NotesController extends AbstractViewController implements NotesCont
|
||||
this.application.sync.sync().catch(console.error)
|
||||
}
|
||||
|
||||
getEditorWidthForNote(note: SNNote) {
|
||||
return (
|
||||
note.editorWidth ?? this.application.getPreference(PrefKey.EditorLineWidth, PrefDefaults[PrefKey.EditorLineWidth])
|
||||
)
|
||||
}
|
||||
|
||||
async setNoteEditorWidth(note: SNNote, editorWidth: EditorLineWidth) {
|
||||
await this.application.mutator.changeItem<NoteMutator>(
|
||||
note,
|
||||
(mutator) => {
|
||||
mutator.editorWidth = editorWidth
|
||||
},
|
||||
false,
|
||||
)
|
||||
this.application.sync.sync().catch(console.error)
|
||||
}
|
||||
|
||||
async addTagToSelectedNotes(tag: SNTag): Promise<void> {
|
||||
const selectedNotes = this.getSelectedNotesList()
|
||||
await Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user