feat: Remove obselete code related to editor preferences (#691)
This commit is contained in:
@@ -108,10 +108,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
|
|
||||||
private removeComponentsObserver!: () => void;
|
private removeComponentsObserver!: () => void;
|
||||||
|
|
||||||
prefKeyMonospace: string;
|
|
||||||
prefKeySpellcheck: string;
|
|
||||||
prefKeyMarginResizers: string;
|
|
||||||
|
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor($timeout: ng.ITimeoutService) {
|
constructor($timeout: ng.ITimeoutService) {
|
||||||
super($timeout);
|
super($timeout);
|
||||||
@@ -121,10 +117,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
this.rightPanelPuppet = {
|
this.rightPanelPuppet = {
|
||||||
onReady: () => this.reloadPreferences(),
|
onReady: () => this.reloadPreferences(),
|
||||||
};
|
};
|
||||||
/** Used by .pug template */
|
|
||||||
this.prefKeyMonospace = PrefKey.EditorMonospaceEnabled;
|
|
||||||
this.prefKeySpellcheck = PrefKey.EditorSpellcheck;
|
|
||||||
this.prefKeyMarginResizers = PrefKey.EditorResizersEnabled;
|
|
||||||
|
|
||||||
this.editorMenuOnSelect = this.editorMenuOnSelect.bind(this);
|
this.editorMenuOnSelect = this.editorMenuOnSelect.bind(this);
|
||||||
this.onPanelResizeFinish = this.onPanelResizeFinish.bind(this);
|
this.onPanelResizeFinish = this.onPanelResizeFinish.bind(this);
|
||||||
@@ -722,30 +714,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleWebPrefKey(key: PrefKey) {
|
|
||||||
const currentValue = (this.state as any)[key];
|
|
||||||
await this.application.setPreference(key, !currentValue);
|
|
||||||
await this.setState({
|
|
||||||
[key]: !currentValue,
|
|
||||||
});
|
|
||||||
this.reloadFont();
|
|
||||||
|
|
||||||
if (key === PrefKey.EditorSpellcheck) {
|
|
||||||
/** Allows textarea to reload */
|
|
||||||
await this.setState({ textareaUnloading: true });
|
|
||||||
await this.setState({ textareaUnloading: false });
|
|
||||||
this.reloadFont();
|
|
||||||
} else if (
|
|
||||||
key === PrefKey.EditorResizersEnabled &&
|
|
||||||
this.state[key] === true
|
|
||||||
) {
|
|
||||||
this.$timeout(() => {
|
|
||||||
this.leftPanelPuppet!.flash!();
|
|
||||||
this.rightPanelPuppet!.flash!();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @components */
|
/** @components */
|
||||||
|
|
||||||
registerComponentHandler() {
|
registerComponentHandler() {
|
||||||
|
|||||||
Reference in New Issue
Block a user