From be77da4fb05d1b5a9f7b93cc3eb411ef4fd85e01 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 23 Jul 2015 10:58:44 -0500
Subject: [PATCH] redactor: Fix thread items not showing in image browse

---
 include/staff/templates/thread-entries.tmpl.php | 4 ++--
 js/redactor-osticket.js                         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/staff/templates/thread-entries.tmpl.php b/include/staff/templates/thread-entries.tmpl.php
index b1e3a83bd..a43e45ba2 100644
--- a/include/staff/templates/thread-entries.tmpl.php
+++ b/include/staff/templates/thread-entries.tmpl.php
@@ -5,8 +5,8 @@ $events->rewind();
 $event = $events->current();
 $htmlId = $options['html-id'] ?: ('thread-'.$this->getId());
 ?>
-<div id="<?php echo $htmlId; ?>" data-thread-id="<?php echo $this->getId(); ?>">
-    <div id="thread-items">
+<div id="<?php echo $htmlId; ?>">
+    <div id="thread-items" data-thread-id="<?php echo $this->getId(); ?>">
     <?php
     if (count($entries)) {
         // Go through all the entries and bucket them by time frame
diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js
index 3b8529754..8f8c29da9 100644
--- a/js/redactor-osticket.js
+++ b/js/redactor-osticket.js
@@ -310,8 +310,8 @@ $(function() {
             options['plugins'].push('fullscreen');
         if (el.data('translateTag'))
             options['plugins'].push('translatable');
-        if ($('#ticket_thread[data-thread-id]').length)
-            options['imageManagerJson'] += '?threadId=' + $('#ticket_thread').data('threadId');
+        if ($('#thread-items[data-thread-id]').length)
+            options['imageManagerJson'] += '?threadId=' + $('#thread-items').data('threadId');
         getConfig().then(function(c) {
             if (c.lang && c.lang.toLowerCase() != 'en_us' &&
                     $.Redactor.opts.langs[c.short_lang])
-- 
GitLab