Skip to content

Commit

Permalink
Fix jQuery focus() deprecation and rebuild 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Jun 8, 2024
1 parent 31eb9a7 commit 45dd72c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions dist/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,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 @@ -759,7 +759,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
Loading

0 comments on commit 45dd72c

Please sign in to comment.