code: function(target) {
  
  		if($(target).closest('.' + PREVENT_CLOSE_CLASS).length) {
  			return;
  		}
  
  		var closeOnContent = mfp.st.closeOnContentClick;
  		var closeOnBg = mfp.st.closeOnBgClick;
  
  		if(closeOnContent && closeOnBg) {
  			return true;
  		} else {
  
  			// We close the popup if click is on close button or on preloader. Or if there is no content.
  			if(!mfp.content || $(target).closest('.mfp-close').length || (mfp.preloader && target === mfp.preloader[0]) ) {
  				return true;
  			}
  
  			// if click is outside the content
  			if(  (target !== mfp.content[0] && !$.contains(mfp.content[0], target))  ) {
  				if(closeOnBg) {
  					// last check, if the clicked element is in DOM, (in case it's removed onclick)
  					if( $.contains(document, target) ) {
  						return true;
  					}
  				}
  			} else if(closeOnContent) {
  				return true;
  			}
  
  		}
  		return false;
  	}
docs: /*
  "Private" helpers that aren't private at all
   Check to close popup or not "target" is an element that was clicked