fixing closing button issue
This commit is contained in:
parent
98c356b201
commit
46fe5ab719
1 changed files with 10 additions and 13 deletions
|
@ -289,18 +289,15 @@
|
||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
// Close.
|
// Handle the × button click and touchend for mobile compatibility
|
||||||
$('<div class="close">Close</div>')
|
$this.find('button.close').each(function() {
|
||||||
.appendTo($this)
|
var closeHandler = function(event) {
|
||||||
.on('click', function() {
|
|
||||||
location.hash = '';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle the × button click
|
|
||||||
$this.find('button.close').on('click', function(event) {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
location.hash = '';
|
location.hash = '';
|
||||||
|
};
|
||||||
|
$(this).on('click', closeHandler);
|
||||||
|
$(this).on('touchend', closeHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prevent clicks from inside article from bubbling.
|
// Prevent clicks from inside article from bubbling.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue