Unverified Commit 802ec71e authored by lauriii's avatar lauriii
Browse files

Issue #3266310 by bnjmnm, Wim Leers, longwave: IE11 user warning has ungraceful failures

(cherry picked from commit 16a374d4)
parent 44d1ac57
......@@ -4,6 +4,13 @@
*/
/* global CKEditor5 */
((Drupal, debounce, CKEditor5, $, once) => {
// CKEditor 5 is incompatible with IE11. When IE11 is detected, the CKEditor5
// variable is null. In those instances, exit early since CKEditor 5 is not
// loaded.
if (!CKEditor5) {
return;
}
/**
* The CKEDITOR instances.
*
......
......@@ -34,6 +34,10 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
(function (Drupal, debounce, CKEditor5, $, once) {
if (!CKEditor5) {
return;
}
Drupal.CKEditor5Instances = new Map();
var callbacks = new Map();
var required = new Set();
......
......@@ -14,6 +14,11 @@
// created. Features such as Quick Edit that require the presence of a
// Drupal.editors.ckeditor5, even for fields that do not use CKEditor 5.
if (isIE11) {
// Explicitly set the global CKEditor5 object to null. This ensures code
// expecting the existence of the object does not fail, but is easily
// distinguishable from a valid CKEditor5 object.
window.CKEditor5 = null;
// This will reference a MutationObserver used by several functions in
// Drupal.editors.ckeditor5. It is declared here and not the editor object
// in order to work with IE11 object scope.
......
......@@ -9,6 +9,7 @@
var isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)');
if (isIE11) {
window.CKEditor5 = null;
var quickEditLabelObserver = null;
Drupal.editors.ckeditor5 = {
attach: function attach(element) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment