From: Radek Czajka Date: Tue, 27 Jun 2023 11:20:19 +0000 (+0200) Subject: fixes X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/14a909d8568d3ce83bd7204a156203dd4c303507?hp=8e8b2c44fc1345b2b4ae2806f2ef5f2187d760c0 fixes --- 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');