From e92c5e649424cde1cc95933ca6f624217afea40e Mon Sep 17 00:00:00 2001
From: Eric Bremner <ebremner@uwaterloo.ca>
Date: Mon, 5 Dec 2022 11:48:41 -0500
Subject: [PATCH] ISTWCMS-5975: adding fix for ckeditor when users are not
 logged in

---
 src/patterns/01-core/ckeditor/ckeditor.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/patterns/01-core/ckeditor/ckeditor.js b/src/patterns/01-core/ckeditor/ckeditor.js
index 411a853f..f42b09ac 100644
--- a/src/patterns/01-core/ckeditor/ckeditor.js
+++ b/src/patterns/01-core/ckeditor/ckeditor.js
@@ -2,13 +2,15 @@
  * Ckeditor Modal
  */
 (function ($, Drupal) {
-  if ($.ui.dialog) {
-    orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
-    $.ui.dialog.prototype._allowInteraction = function (event) {
-      if ($(event.target).closest('.cke_dialog').length) {
-        return true;
-      }
-      return orig_allowInteraction.apply(this, arguments);
-    };
+  if ($.ui !== undefined) {
+    if ($.ui.dialog) {
+      orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
+      $.ui.dialog.prototype._allowInteraction = function (event) {
+        if ($(event.target).closest('.cke_dialog').length) {
+          return true;
+        }
+        return orig_allowInteraction.apply(this, arguments);
+      };
+    }
   }
 })(jQuery, Drupal);
-- 
GitLab