MOBILE-3947 chore: Deprecation fixes
parent
a81f93822f
commit
4ca0cf785a
|
@ -174,6 +174,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
|||
this.lastDraft = this.control?.value;
|
||||
|
||||
// Use paragraph on enter.
|
||||
// eslint-disable-next-line deprecation/deprecation
|
||||
document.execCommand('DefaultParagraphSeparator', false, 'p');
|
||||
|
||||
this.maximizeEditorSize();
|
||||
|
@ -632,6 +633,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
|||
*/
|
||||
protected executeCommand({ name: command, parameters }: EditorCommand): void {
|
||||
if (parameters == 'block') {
|
||||
// eslint-disable-next-line deprecation/deprecation
|
||||
document.execCommand('formatBlock', false, '<' + command + '>');
|
||||
|
||||
return;
|
||||
|
@ -641,6 +643,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
|||
this.toolbarStyles[parameters] = this.toolbarStyles[parameters] == 'true' ? 'false' : 'true';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line deprecation/deprecation
|
||||
document.execCommand(command, false);
|
||||
|
||||
// Modern browsers are using non a11y tags, so replace them.
|
||||
|
@ -1043,6 +1046,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
|||
|
||||
if (text) {
|
||||
this.editorElement?.focus(); // Make sure the editor is focused.
|
||||
// eslint-disable-next-line deprecation/deprecation
|
||||
document.execCommand('insertText', false, text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,12 +349,15 @@ export class CoreLangProvider {
|
|||
getTranslationTable(lang: string): Promise<Record<string, unknown>> {
|
||||
// Create a promise to convert the observable into a promise.
|
||||
return new Promise((resolve, reject): void => {
|
||||
const observer = Translate.getTranslation(lang).subscribe((table) => {
|
||||
const observer = Translate.getTranslation(lang).subscribe({
|
||||
next: (table) => {
|
||||
resolve(table);
|
||||
observer.unsubscribe();
|
||||
}, (err) => {
|
||||
},
|
||||
error: (err) => {
|
||||
reject(err);
|
||||
observer.unsubscribe();
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -376,7 +376,7 @@ export class CoreUtilsProvider {
|
|||
virtualInput.innerHTML = text;
|
||||
virtualInput.select();
|
||||
virtualInput.setSelectionRange(0, 99999);
|
||||
document.execCommand('copy');
|
||||
document.execCommand('copy'); // eslint-disable-line deprecation/deprecation
|
||||
}
|
||||
|
||||
// Show toast using ionicLoading.
|
||||
|
|
Loading…
Reference in New Issue