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