Unverified Commit 29ab0121 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

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

parent a34d0d6e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.
   *
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@
**/

((Drupal, debounce, CKEditor5, $, once) => {
  if (!CKEditor5) {
    return;
  }

  Drupal.CKEditor5Instances = new Map();
  const callbacks = new Map();
  const required = new Set();
+5 −0
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
  const isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)');

  if (isIE11) {
    window.CKEditor5 = null;
    let quickEditLabelObserver = null;
    Drupal.editors.ckeditor5 = {
      attach: function attach(element) {