Skip to content

Commit

Permalink
0.9.9 version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Nov 15, 2013
1 parent 99b00b8 commit c1ca7bc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magnific-popup",
"version": "0.9.8",
"version": "0.9.9",
"main": [
"dist/jquery.magnific-popup.js",
"dist/magnific-popup.css"
Expand Down
27 changes: 14 additions & 13 deletions dist/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Magnific Popup - v0.9.8 - 2013-10-26
/*! Magnific Popup - v0.9.9 - 2013-11-15
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2013 Dmitry Semenov; */
;(function($) {
Expand Down Expand Up @@ -76,9 +76,6 @@ var _mfpOn = function(name, f) {
}
}
},
_setFocus = function() {
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
},
_getCloseBtn = function(type) {
if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
Expand Down Expand Up @@ -360,19 +357,14 @@ MagnificPopup.prototype = {

if(mfp.content) {
mfp._addClassToMFP(READY_CLASS);
_setFocus();
mfp._setFocus();
} else {
// if content is not defined (not loaded e.t.c) we add class only for BG
mfp.bgOverlay.addClass(READY_CLASS);
}

// Trap the focus in popup
_document.on('focusin' + EVENT_NS, function (e) {
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
_setFocus();
return false;
}
});
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);

}, 16);

Expand Down Expand Up @@ -762,6 +754,15 @@ MagnificPopup.prototype = {
_hasScrollBar: function(winHeight) {
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();
},
_onFocusIn: function(e) {
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
mfp._setFocus();
return false;
}
},
_parseMarkup: function(template, values, item) {
var arr;
if(item.data) {
Expand Down Expand Up @@ -1098,7 +1099,7 @@ $.magnificPopup.registerModule(AJAX_NS, {

_removeAjaxCursor();

_setFocus();
mfp._setFocus();

setTimeout(function() {
mfp.wrap.addClass(READY_CLASS);
Expand Down Expand Up @@ -2038,4 +2039,4 @@ $.magnificPopup.registerModule(RETINA_NS, {
})();

/*>>fastclick*/
})(window.jQuery || window.Zepto);
_checkInstance(); })(window.jQuery || window.Zepto);
Loading

0 comments on commit c1ca7bc

Please sign in to comment.