Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed May 5, 2013
1 parent e998cf7 commit 08d8f01
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ MagnificPopup.prototype = {

mfp.container = _getEl('container', mfp.wrap);
}

mfp.contentContainer = _getEl('content');
if(mfp.st.preloader) {
mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
}
mfp.contentContainer = _getEl('content', mfp.container);



// Initializing modules
Expand Down Expand Up @@ -427,6 +427,9 @@ MagnificPopup.prototype = {
updateItemHTML: function() {
var item = mfp.items[mfp.index];

// Detach and perform modifications
mfp.contentContainer.detach();

if(!item.parsed) {
item = mfp.parseEl( mfp.index );
}
Expand All @@ -448,14 +451,17 @@ MagnificPopup.prototype = {
if(_prevContentType && _prevContentType !== item.type) {
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
}

var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
mfp.appendContent(newContent, type);

item.preloaded = true;

_mfpTrigger(CHANGE_EVENT, item);
_prevContentType = item.type;

// Append container back after its content changed
mfp.container.prepend(mfp.contentContainer);
},


Expand Down

0 comments on commit 08d8f01

Please sign in to comment.