feat: Remove obselete code related to editor preferences (#691)

This commit is contained in:
Aman Harwara
2021-10-17 21:24:02 +05:30
committed by GitHub
parent 4ce9264572
commit bbeab4f623

View File

@@ -108,10 +108,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
private removeComponentsObserver!: () => void;
prefKeyMonospace: string;
prefKeySpellcheck: string;
prefKeyMarginResizers: string;
/* @ngInject */
constructor($timeout: ng.ITimeoutService) {
super($timeout);
@@ -121,10 +117,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
this.rightPanelPuppet = {
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.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 */
registerComponentHandler() {