fixing closing button issue
This commit is contained in:
parent
98c356b201
commit
46fe5ab719
1 changed files with 10 additions and 13 deletions
|
@ -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();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue