Skip to content

Node.js based forum software built for the modern web

fix: don't toggle elements if there is no inputEl

Barış Soner Uşaklı57f67e2b9116
diff --git a/public/src/client/post-queue.js b/public/src/client/post-queue.js
index 49c4ccae66..91f8401a25 100644
--- a/public/src/client/post-queue.js
+++ b/public/src/client/post-queue.js
@@ -65,9 +65,11 @@ define('forum/post-queue', ['categorySelector'], function (categorySelector) {
function handleContentEdit(displayClass, editableClass, inputSelector) {
$('.posts-list').on('click', displayClass, function () {
var el = $(this);
- el.addClass('hidden');
var inputEl = el.parent().find(editableClass);
- inputEl.removeClass('hidden').find(inputSelector).focus();
+ if (inputEl.length) {
+ el.addClass('hidden');
+ inputEl.removeClass('hidden').find(inputSelector).focus();
+ }
});
$('.posts-list').on('blur', editableClass + ' ' + inputSelector, function () {