fixing closing button issue

This commit is contained in:
Tobi 2025-06-20 22:36:28 +02:00
parent 98c356b201
commit 46fe5ab719

View file

@ -289,24 +289,21 @@
var $this = $(this);
// Close.
$('<div class="close">Close</div>')
.appendTo($this)
.on('click', function() {
location.hash = '';
});
// Handle the × button click
$this.find('button.close').on('click', function(event) {
// Handle the × button click and touchend for mobile compatibility
$this.find('button.close').each(function() {
var closeHandler = function(event) {
event.preventDefault();
event.stopPropagation();
location.hash = '';
});
};
$(this).on('click', closeHandler);
$(this).on('touchend', closeHandler);
});
// Prevent clicks from inside article from bubbling.
$this.on('click', function(event) {
event.stopPropagation();
});
$this.on('click', function(event) {
event.stopPropagation();
});
});