Skip to content

Commit

Permalink
Options object that you pass to popup gets modified after the initial…
Browse files Browse the repository at this point in the history
…ization (close #203, close #217)
  • Loading branch information
dimsemenov committed Sep 29, 2013
1 parent 99ce7b8 commit c48ede2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ MagnificPopup.prototype = {
mfp.isOpen = true;
mfp.updateSize(windowHeight);
_mfpTrigger(OPEN_EVENT);

return data;
},

/**
Expand Down Expand Up @@ -821,8 +823,12 @@ $.magnificPopup = {
open: function(options, index) {
_checkInstance();

if(!options)
if(!options) {
options = {};
} else {
options = $.extend(true, {}, options);
}


options.isObj = true;
options.index = index || 0;
Expand Down Expand Up @@ -920,7 +926,9 @@ $.fn.magnificPopup = function(options) {
}

} else {

// clone options obj
options = $.extend(true, {}, options);

/*
* As Zepto doesn't support .data() method for objects
* and it works only in normal browsers
Expand Down

0 comments on commit c48ede2

Please sign in to comment.