From 14a909d8568d3ce83bd7204a156203dd4c303507 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 27 Jun 2023 13:20:19 +0200 Subject: [PATCH 1/1] fixes --- src/redakcja/static/js/wiki/caret.js | 2 +- src/redakcja/static/js/wiki/view_properties.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redakcja/static/js/wiki/caret.js b/src/redakcja/static/js/wiki/caret.js index 7026e2f5..b2cf1826 100644 --- a/src/redakcja/static/js/wiki/caret.js +++ b/src/redakcja/static/js/wiki/caret.js @@ -30,7 +30,7 @@ class Caret { if (!selection.isCollapsed) return; var anchorNode = selection.anchorNode; // Is selection still inside a node? - if (!$(anchorNode).closest('[x-node]')) return; + if (!$(anchorNode).closest('[x-node]').length) return; self.singleClick = true; setTimeout(function() { diff --git a/src/redakcja/static/js/wiki/view_properties.js b/src/redakcja/static/js/wiki/view_properties.js index 54051737..e38a7d07 100644 --- a/src/redakcja/static/js/wiki/view_properties.js +++ b/src/redakcja/static/js/wiki/view_properties.js @@ -157,6 +157,7 @@ var modal = $(this); modal.data('target-input', input); var imglist = modal.find('.modal-body'); + imglist.html(''); $.each(self.doc.galleryImages, (i, imgItem) => { img = $("").attr("src", imgItem.thumb).attr('title', imgItem.url).data('url', imgItem.url).on('click', function() { imglist.find('img').removeClass('active'); -- 2.20.1