Skip to content

Commit 45dd72c

Browse files
committed
Fix jQuery focus() deprecation and rebuild 1.2.0
1 parent 31eb9a7 commit 45dd72c

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

dist/jquery.magnific-popup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ MagnificPopup.prototype = {
445445

446446

447447
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
448-
$(mfp._lastFocusedEl).focus(); // put tab focus back
448+
$(mfp._lastFocusedEl).trigger('focus'); // put tab focus back
449449
}
450450
mfp.currItem = null;
451451
mfp.content = null;
@@ -759,7 +759,7 @@ MagnificPopup.prototype = {
759759
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
760760
},
761761
_setFocus: function() {
762-
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
762+
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger('focus');
763763
},
764764
_onFocusIn: function(e) {
765765
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {

0 commit comments

Comments
 (0)