|
1 | | -/*! Magnific Popup - v0.9.5 - 2013-08-21 |
| 1 | +/*! Magnific Popup - v0.9.6 - 2013-09-29 |
2 | 2 | * http://dimsemenov.com/plugins/magnific-popup/ |
3 | 3 | * Copyright (c) 2013 Dmitry Semenov; */ |
4 | 4 | ;(function($) { |
@@ -414,6 +414,8 @@ MagnificPopup.prototype = { |
414 | 414 | mfp.isOpen = true; |
415 | 415 | mfp.updateSize(windowHeight); |
416 | 416 | _mfpTrigger(OPEN_EVENT); |
| 417 | + |
| 418 | + return data; |
417 | 419 | }, |
418 | 420 |
|
419 | 421 | /** |
@@ -827,16 +829,20 @@ $.magnificPopup = { |
827 | 829 | open: function(options, index) { |
828 | 830 | _checkInstance(); |
829 | 831 |
|
830 | | - if(!options) |
| 832 | + if(!options) { |
831 | 833 | options = {}; |
| 834 | + } else { |
| 835 | + options = $.extend(true, {}, options); |
| 836 | + } |
| 837 | + |
832 | 838 |
|
833 | 839 | options.isObj = true; |
834 | 840 | options.index = index || 0; |
835 | 841 | return this.instance.open(options); |
836 | 842 | }, |
837 | 843 |
|
838 | 844 | close: function() { |
839 | | - return $.magnificPopup.instance.close(); |
| 845 | + return $.magnificPopup.instance && $.magnificPopup.instance.close(); |
840 | 846 | }, |
841 | 847 |
|
842 | 848 | registerModule: function(name, module) { |
@@ -926,7 +932,9 @@ $.fn.magnificPopup = function(options) { |
926 | 932 | } |
927 | 933 |
|
928 | 934 | } else { |
929 | | - |
| 935 | + // clone options obj |
| 936 | + options = $.extend(true, {}, options); |
| 937 | + |
930 | 938 | /* |
931 | 939 | * As Zepto doesn't support .data() method for objects |
932 | 940 | * and it works only in normal browsers |
@@ -1058,7 +1066,7 @@ $.magnificPopup.registerModule(AJAX_NS, { |
1058 | 1066 | mfp.types.push(AJAX_NS); |
1059 | 1067 | _ajaxCur = mfp.st.ajax.cursor; |
1060 | 1068 |
|
1061 | | - _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, function() { |
| 1069 | + _mfpOn(CLOSE_EVENT+'.'+AJAX_NS + ' BeforeChange.' + AJAX_NS, function() { |
1062 | 1070 | _removeAjaxCursor(); |
1063 | 1071 | if(mfp.req) { |
1064 | 1072 | mfp.req.abort(); |
@@ -1384,7 +1392,8 @@ $.magnificPopup.registerModule('zoom', { |
1384 | 1392 |
|
1385 | 1393 | initZoom: function() { |
1386 | 1394 | var zoomSt = mfp.st.zoom, |
1387 | | - ns = '.zoom'; |
| 1395 | + ns = '.zoom', |
| 1396 | + image; |
1388 | 1397 |
|
1389 | 1398 | if(!zoomSt.enabled || !mfp.supportsTransition) { |
1390 | 1399 | return; |
@@ -1488,6 +1497,7 @@ $.magnificPopup.registerModule('zoom', { |
1488 | 1497 | if(animatedImg) { |
1489 | 1498 | animatedImg.remove(); |
1490 | 1499 | } |
| 1500 | + image = null; |
1491 | 1501 | } |
1492 | 1502 | }); |
1493 | 1503 | }, |
|
0 commit comments