src/js/core.js
function() {
		var item = mfp.items[mfp.index];

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

		if(mfp.content)
			mfp.content.detach();

		if(!item.parsed) {
			item = mfp.parseEl( mfp.index );
		}

		var type = item.type;

		_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
		// BeforeChange event works like so:
		// _mfpOn('BeforeChange', function(e, prevType, newType) { });

		mfp.currItem = item;

		if(!mfp.currTemplate[type]) {
			var markup = mfp.st[type] ? mfp.st[type].markup : false;

			// allows to modify markup
			_mfpTrigger('FirstMarkupParse', markup);

			if(markup) {
				mfp.currTemplate[type] = $(markup);
			} else {
				// if there is no markup found we just define that template is parsed
				mfp.currTemplate[type] = true;
			}
		}

		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);

		_mfpTrigger('AfterChange');
	}
function() {
		var item = mfp.items[mfp.index];

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

		if(mfp.content)
			mfp.content.detach();

		if(!item.parsed) {
			item = mfp.parseEl( mfp.index );
		}

		var type = item.type;

		_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
		// BeforeChange event works like so:
		// _mfpOn('BeforeChange', function(e, prevType, newType) { });

		mfp.currItem = item;

		if(!mfp.currTemplate[type]) {
			var markup = mfp.st[type] ? mfp.st[type].markup : false;

			// allows to modify markup
			_mfpTrigger('FirstMarkupParse', markup);

			if(markup) {
				mfp.currTemplate[type] = $(markup);
			} else {
				// if there is no markup found we just define that template is parsed
				mfp.currTemplate[type] = true;
			}
		}

		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);

		_mfpTrigger('AfterChange');
	}
function ( ) { var item = mfp . items [ mfp . index ] ; // Detach and perform modifications mfp . contentContainer . detach ( ) ; if ( mfp . content ) mfp . content . detach ( ) ; if ( ! item . parsed ) { item = mfp . parseEl ( mfp . index ) ; } var type = item . type ; _mfpTrigger ( 'BeforeChange' , [ mfp . currItem ? mfp . currItem . type : '' , type ] ) ; // BeforeChange event works like so: // _mfpOn('BeforeChange', function(e, prevType, newType) { }); mfp . currItem = item ; if ( ! mfp . currTemplate [ type ] ) { var markup = mfp . st [ type ] ? mfp . st [ type ] . markup : false ; // allows to modify markup _mfpTrigger ( 'FirstMarkupParse' , markup ) ; if ( markup ) { mfp . currTemplate [ type ] = $ ( markup ) ; } else { // if there is no markup found we just define that template is parsed mfp . currTemplate [ type ] = true ; } } 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 ) ; _mfpTrigger ( 'AfterChange' ) ; }
Set content of popup based on current index
Set content of popup based on current index