Merge pull request #1229 from ZogStriP/close-lightbox-when-using-back-button

FIX: lightbox is not closed when using the back button
This commit is contained in:
Robin Ward 2013-07-22 07:29:53 -07:00
commit 0f1533f41d
2 changed files with 5 additions and 6 deletions

View File

@ -8,12 +8,9 @@
Discourse.Lightbox = {
apply: function($elem) {
var _this = this;
$('a.lightbox', $elem).each(function(i, e) {
$LAB.script("/javascripts/jquery.magnific-popup-min.js").wait(function() {
$(e).magnificPopup({
type: 'image',
closeOnContentClick: true
});
$LAB.script("/javascripts/jquery.magnific-popup-min.js").wait(function() {
$('a.lightbox', $elem).each(function(i, e) {
$(e).magnificPopup({ type: 'image', closeOnContentClick: true });
});
});
}

View File

@ -23,6 +23,8 @@ Discourse.Route = Em.Route.extend({
$('.d-dropdown').hide();
$('header ul.icons li').removeClass('active');
$('[data-toggle="dropdown"]').parent().removeClass('open');
// close the lightbox
if ($.magnificPopup && $.magnificPopup.instance) { $.magnificPopup.instance.close(); }
Discourse.set('notifyCount',0);