Issue #3270108 by bnjmnm, Wim Leers: Editor does not load when using Edge + WHCM

merge-requests/2002/head
Lauri Eskola 2022-03-21 10:36:58 +02:00
parent 2fbd9f71bc
commit bac77053c4
No known key found for this signature in database
GPG Key ID: 382FC0F5B0DF53F8
5 changed files with 12 additions and 18 deletions

View File

@ -90,7 +90,6 @@ ie11.user.warnings:
- core/drupal
- core/drupal.message
- editor/drupal.editor
- core/modernizr
ie11.filter.warnings:
js:
@ -99,7 +98,6 @@ ie11.filter.warnings:
- core/drupal
- core/drupal.message
- core/once
- core/modernizr
drupal.ckeditor5.filter.admin:
js:

View File

@ -3,7 +3,7 @@
* Provides IE11 compatibility warnings when choosing a text editor.
*/
((Drupal, once, Modernizr) => {
((Drupal, once) => {
/**
* Presents a warning when selecting CKEditor 5 as a text format's text editor.
*
@ -11,9 +11,7 @@
*/
Drupal.behaviors.ckEditor5warn = {
attach: function attach() {
const isIE11 = Modernizr.mq(
'(-ms-high-contrast: active), (-ms-high-contrast: none)',
);
const isIE11 = !!document.documentMode;
const editorSelect = once(
'editor-ie11-warning',
'[data-drupal-selector="filter-format-edit-form"] [data-drupal-selector="edit-editor-editor"], [data-drupal-selector="filter-format-add-form"] [data-drupal-selector="edit-editor-editor"]',
@ -120,4 +118,4 @@
}
},
};
})(Drupal, once, Modernizr);
})(Drupal, once);

View File

@ -5,10 +5,10 @@
* @preserve
**/
(function (Drupal, once, Modernizr) {
(function (Drupal, once) {
Drupal.behaviors.ckEditor5warn = {
attach: function attach() {
var isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)');
var isIE11 = !!document.documentMode;
var editorSelect = once('editor-ie11-warning', '[data-drupal-selector="filter-format-edit-form"] [data-drupal-selector="edit-editor-editor"], [data-drupal-selector="filter-format-add-form"] [data-drupal-selector="edit-editor-editor"]');
if (typeof editorSelect[0] !== 'undefined') {
@ -66,4 +66,4 @@
}
}
};
})(Drupal, once, Modernizr);
})(Drupal, once);

View File

@ -3,10 +3,8 @@
* Provide warnings when attempting to load CKEditor 5 on IE11.
*/
((Drupal, Modernizr) => {
const isIE11 = Modernizr.mq(
'(-ms-high-contrast: active), (-ms-high-contrast: none)',
);
((Drupal) => {
const isIE11 = !!document.documentMode;
// If the browser is IE11, create an alternate version of
// Drupal.editors.ckeditor5 that provides warnings. In IE11, the incompatible
@ -143,4 +141,4 @@
},
};
}
})(Drupal, Modernizr);
})(Drupal);

View File

@ -5,8 +5,8 @@
* @preserve
**/
(function (Drupal, Modernizr) {
var isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)');
(function (Drupal) {
var isIE11 = !!document.documentMode;
if (isIE11) {
window.CKEditor5 = null;
@ -64,4 +64,4 @@
}
};
}
})(Drupal, Modernizr);
})(Drupal);