Skip to content

Commit

Permalink
0.8.9 - see changelog for details
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Jun 4, 2013
1 parent e7c047b commit 2cb54d6
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 44 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Fast, light and responsive lightbox plugin, for jQuery and Zepto.js.
- [Examples and plugin home page](http://dimsemenov.com/plugins/magnific-popup/)
- More examples on [CodePen](http://codepen.io/collection/nLcqo). Feel free to email me more CodePen's, I'd gladly add them to this collection.

Optionally, install via Bower: `bower install magnific-popup`.

## Location of stuff

- Generated popup JS and CSS files are in folder [dist/](https://github.com/dimsemenov/Magnific-Popup/tree/master/dist). (Online build tool is on [documentation page](http://dimsemenov.com/plugins/magnific-popup/documentation.html)).
Expand Down Expand Up @@ -37,6 +39,18 @@ Optionally:

## Changelog

### 0.8.9 (Jun 4, 2013)

- Fix: inline element that is created dynamically causes exception in jQuery 1.8.x.
- Fix: incorrect detection of `_hasScrollBar` if body has defined height style.
- Fix: body styles are kept after popup is closed.
- Fix: close icon is aligned incorrectly with iframe type.
- **responseText is deprected**. Argument of callback `parseAjax` - `obj.responseText` is now deprected, but you can still access it via `obj.xhr.responseText`. Instead of it, please use `obj.data` to modify your output.
- Sass: changed variables to be default declarations to support front-loaded settings. i.e. You can override options by adding `_settings.scss` file near `main.scss` with your new options.
- Added: `afterClose` event.
- Added: `ajaxContentLoaded` event.
- Added: [Bower](https://github.com/bower/bower) support.

### 0.8.8 (May 24, 2013)

- Fix: you can now put link inside popup that will open another popup - http://codepen.io/dimsemenov/pen/hwIng
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magnific-popup",
"version": "0.8.8",
"version": "0.8.9",
"main": [
"dist/jquery.magnific-popup.js",
"dist/magnific-popup.css"
Expand Down
20 changes: 13 additions & 7 deletions dist/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Magnific Popup - v0.8.8 - 2013-06-04
/*! Magnific Popup - v0.8.9 - 2013-06-04
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2013 Dmitry Semenov; */
;(function($) {
Expand Down Expand Up @@ -228,7 +228,7 @@ 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);
Expand Down Expand Up @@ -462,6 +462,10 @@ MagnificPopup.prototype = {
} else {
mfp.wH = winHeight || _window.height();
}
// Fixes #84: popup incorrectly positioned with position:relative on body
if(!mfp.fixedContentPos) {
mfp.wrap.css('height', mfp.wH);
}

_mfpTrigger('Resize');

Expand Down Expand Up @@ -1022,12 +1026,14 @@ $.magnificPopup.registerModule(AJAX_NS, {
var opts = $.extend({
url: item.src,
success: function(data, textStatus, jqXHR) {
var temp = {
data:data,
xhr:jqXHR
};

var data = {responseText:jqXHR.responseText};
_mfpTrigger('ParseAjax', temp);

_mfpTrigger('ParseAjax', data);

mfp.appendContent( $(data.responseText), AJAX_NS );
mfp.appendContent( $(temp.data), AJAX_NS );

item.finished = true;

Expand All @@ -1040,7 +1046,7 @@ $.magnificPopup.registerModule(AJAX_NS, {
}, 16);

mfp.updateStatus('ready');

_mfpTrigger('AjaxContentAdded');
},
error: function() {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.magnific-popup.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion magnific-popup.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magnific-popup",
"title": "Magnific Popup",
"description": "Fast, light, mobile-friendly and responsive lightbox plugin with focus on performance. Open inline HTML, ajax loaded content, image, form, iframe (YouTube and Vimeo video, Google Maps), photo gallery. Easily add in/out animation effects with help of CSS3 transitions.",
"version": "0.8.8",
"version": "0.8.9",
"homepage": "http://dimsemenov.com/plugins/magnific-popup/",
"demo": "http://dimsemenov.com/plugins/magnific-popup/",
"docs": "http://dimsemenov.com/plugins/magnific-popup/documentation.html",
Expand Down
2 changes: 1 addition & 1 deletion website/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ exclude: [".json", ".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changel
auto: true
pygments: true

mfpversion: 0.8.8
mfpversion: 0.8.9
17 changes: 0 additions & 17 deletions website/_includes/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
<h2 id="examples">Examples</h2>

<div class="grid-c">


<div class="example gc3">
<h3>Single image lightbox</h3>
<p>Three simple popups with different scaling settings. First one fits in area horizontally and vertically, second one - only horizontally, third one - has no gaps and close button is always in top right corner.</p>
Expand Down Expand Up @@ -456,21 +454,6 @@ <h3>Ajax popup</h3>
$('.simple-ajax-popup-align-top').magnificPopup({
type: 'ajax',
alignTop: true,
// callbacks: {
// parseAjax: function(data) {
// console.log('Loading of ajax content finished. Object:', data.responseText);
// // data.responseText contains HTML text that will be inserted to DOM
// // You may modify it however you wish
// // data.responseText can be a String or a DOM (jQuery) element

// // For example, to show just #some-element:
// // data.responseText = $(data.responseText).find('#some-element');
// },
// ajaxContentAdded: function() {
// // Ajax content is loaded and appended to DOM
// console.log(this.content);
// }
// },
overflowY: 'scroll' // as we know that popup content is tall we set scroll overflow by default to avoid jump
});

Expand Down
36 changes: 21 additions & 15 deletions website/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,20 @@ To modify content after it's loaded, or to select and show just specific element

{% highlight javascript %}
callbacks: {
parseAjax: function(data) {
console.log('Loading of ajax content finished. Object:', data.responseText);
// data.responseText contains HTML text that will be inserted to DOM
// You may modify it however you wish
// data.responseText can be a String or a DOM (jQuery) element

parseAjax: function(mfpResponse) {
// mfpResponse.data is a "data" object from ajax "success" callback
// for simple HTML file, it will be just String
// You may modify it to change contents of the popup
// For example, to show just #some-element:
// data.responseText = $(data.responseText).find('#some-element');
// mfpResponse.data = $(mfpResponse.data).find('#some-element');

// mfpResponse.data must be a String or a DOM (jQuery) element

console.log('Ajax content loaded:', mfpResponse);
},
ajaxContentAdded: function() {
console.log('Content is in DOM:', this.content);
// Ajax content is loaded and appended to DOM
console.log(this.content);
}
}
{% endhighlight %}
Expand Down Expand Up @@ -842,15 +845,18 @@ callbacks: {
// here you may modify URL, type, or any other data
},

// Only for ajax
parseAjax: function(data) {
console.log('Loading of ajax content finished. Object:', data.responseText);
// data.responseText contains HTML text that will be inserted to DOM
// You may modify it however you wish
// data.responseText can be a String or a DOM (jQuery) element

// Only for ajax popup type
parseAjax: function(mfpResponse) {
// mfpResponse.data is a "data" object from ajax "success" callback
// for simple HTML file, it will be just String
// You may modify it to change contents of the popup
// For example, to show just #some-element:
// data.responseText = $(data.responseText).find('#some-element');
// mfpResponse.data = $(mfpResponse.data).find('#some-element');

// mfpResponse.data must be a String or a DOM (jQuery) element

console.log('Ajax content loaded:', mfpResponse);
},
ajaxContentAdded: function() {
// Ajax content is loaded and appended to DOM
Expand Down

0 comments on commit 2cb54d6

Please sign in to comment.