FIX: lightbox is not closed when using the back button
This commit is contained in:
parent
33e3f123b4
commit
418d8c7377
|
@ -8,12 +8,9 @@
|
||||||
Discourse.Lightbox = {
|
Discourse.Lightbox = {
|
||||||
apply: function($elem) {
|
apply: function($elem) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
$('a.lightbox', $elem).each(function(i, e) {
|
$LAB.script("/javascripts/jquery.magnific-popup-min.js").wait(function() {
|
||||||
$LAB.script("/javascripts/jquery.magnific-popup-min.js").wait(function() {
|
$('a.lightbox', $elem).each(function(i, e) {
|
||||||
$(e).magnificPopup({
|
$(e).magnificPopup({ type: 'image', closeOnContentClick: true });
|
||||||
type: 'image',
|
|
||||||
closeOnContentClick: true
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ Discourse.Route = Em.Route.extend({
|
||||||
$('.d-dropdown').hide();
|
$('.d-dropdown').hide();
|
||||||
$('header ul.icons li').removeClass('active');
|
$('header ul.icons li').removeClass('active');
|
||||||
$('[data-toggle="dropdown"]').parent().removeClass('open');
|
$('[data-toggle="dropdown"]').parent().removeClass('open');
|
||||||
|
// close the lightbox
|
||||||
|
if ($.magnificPopup && $.magnificPopup.instance) { $.magnificPopup.instance.close(); }
|
||||||
|
|
||||||
Discourse.set('notifyCount',0);
|
Discourse.set('notifyCount',0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue