DEV: avoids jquery usage

DEV: avoids jquery usage

diff --git a/assets/javascripts/initializers/discourse-post-event-decorator.js.es6 b/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
index 369f461..02cee22 100644
--- a/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
+++ b/assets/javascripts/initializers/discourse-post-event-decorator.js.es6
@@ -183,10 +183,10 @@ function _attachWidget(api, cooked, eventModel) {
 function initializeDiscoursePostEventDecorator(api) {
   api.cleanupStream(cleanUp);
 
-  api.decorateCooked(
-    ($cooked, helper) => {
-      if ($cooked[0].classList.contains("d-editor-preview")) {
-        _decorateEventPreview(api, $cooked[0]);
+  api.decorateCookedElement(
+    (cooked, helper) => {
+      if (cooked.classList.contains("d-editor-preview")) {
+        _decorateEventPreview(api, cooked);
         return;
       }
 
@@ -194,7 +194,7 @@ function initializeDiscoursePostEventDecorator(api) {
         const post = helper.getModel();
 
         if (post.event) {
-          _decorateEvent(api, $cooked[0], post.event);
+          _decorateEvent(api, cooked, post.event);
         }
       }
     },

GitHub sha: 9068f6fe

1 Like