From 4b97684e22d9a1140d789cf35a2aa31048a11688 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Wed, 26 Nov 2014 00:06:28 +0100 Subject: [PATCH] fix editing when avatars are disabled --- isso/js/app/isso.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js index 21aec7c..61cef97 100644 --- a/isso/js/app/isso.js +++ b/isso/js/app/isso.js @@ -183,7 +183,7 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n", $("a.edit", footer).toggle("click", function(toggler) { var edit = $("a.edit", footer); - var avatar = $(".avatar", el, false)[0]; + var avatar = config["avatar"] ? $(".avatar", el, false)[0] : null; edit.textContent = i18n.translate("comment-save"); edit.insertAfter($.new("a.cancel", i18n.translate("comment-cancel"))).on("click", function() { @@ -211,7 +211,7 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n", }, function(toggler) { var textarea = $(".textarea", text); - var avatar = $(".avatar", el, false)[0]; + var avatar = config["avatar"] ? $(".avatar", el, false)[0] : null; if (! toggler.canceled && textarea !== null) { if (utils.text(textarea.innerHTML).length < 3) {