Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ MagnificPopup.prototype = {


if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
$(mfp._lastFocusedEl).focus(); // put tab focus back
$(mfp._lastFocusedEl).trigger('focus'); // put tab focus back
}
mfp.currItem = null;
mfp.content = null;
Expand Down Expand Up @@ -624,7 +624,7 @@ MagnificPopup.prototype = {
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;

if(disableOn) {
if($.isFunction(disableOn)) {
if(typeof disableOn === 'function') {
if( !disableOn.call(mfp) ) {
return true;
}
Expand Down Expand Up @@ -738,7 +738,7 @@ MagnificPopup.prototype = {
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
},
_setFocus: function() {
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger('focus');
},
_onFocusIn: function(e) {
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
Expand Down Expand Up @@ -936,4 +936,4 @@ $.fn.magnificPopup = function(options) {

}
return jqEl;
};
};
4 changes: 2 additions & 2 deletions src/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ $.magnificPopup.registerModule('gallery', {
mfp.arrowPrev = arrowLeft;
}

arrowLeft.click(function() {
arrowLeft.on('click', function() {
if (gSt.langDir === 'rtl') mfp.next();
else mfp.prev();
});
arrowRight.click(function() {
arrowRight.on('click', function() {
if (gSt.langDir === 'rtl') mfp.prev();
else mfp.next();
});
Expand Down
4 changes: 2 additions & 2 deletions src/js/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var _imgInterval,
var src = mfp.st.image.titleSrc;

if(src) {
if($.isFunction(src)) {
if(typeof src === 'function') {
return src.call(mfp, item);
} else if(item.el) {
return item.el.attr(src) || '';
Expand Down Expand Up @@ -241,4 +241,4 @@ $.magnificPopup.registerModule('image', {
return template;
}
}
});
});