Skip to content

Commit

Permalink
Fix code scanning alert no. 2: Unsafe jQuery plugin
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent ad1b90a commit de7bcc1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion assets/js/plugins/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,14 @@ MagnificPopup.prototype = {
$('html').css(windowStyles);

// add everything to DOM
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body );
var prependTarget = _body;
if (mfp.st.prependTo) {
prependTarget = $(document).find(mfp.st.prependTo);
if (prependTarget.length === 0) {
prependTarget = _body;
}
}
mfp.bgOverlay.add(mfp.wrap).prependTo(prependTarget);

// Save last focused element
mfp._lastFocusedEl = document.activeElement;
Expand Down

0 comments on commit de7bcc1

Please sign in to comment.