Skip to content

Commit

Permalink
fix: don't toggle elements if there is no inputEl
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Sep 3, 2020
1 parent 0a24260 commit 57f67e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/src/client/post-queue.js
Expand Up @@ -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 () {
Expand Down

0 comments on commit 57f67e2

Please sign in to comment.