diff --git a/assets/js/main.js b/assets/js/main.js index 733430c..baccbf0 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -296,6 +296,11 @@ location.hash = ''; }); + // Add click handler for the × button + $this.find('.close').on('click', function() { + location.hash = ''; + }); + // Prevent clicks from inside article from bubbling. $this.on('click', function(event) { event.stopPropagation(); @@ -396,9 +401,4 @@ $main._show(location.hash.substr(1), true); }); - // Close button functionality - $('.close').on('click', function() { - $main._hide(true); - }); - })(jQuery); \ No newline at end of file