Skip to content

Commit

Permalink
Added an additional check if image has size or not, ignoring the brow…
Browse files Browse the repository at this point in the history
…ser cache
  • Loading branch information
dimsemenov committed Nov 25, 2013
1 parent 69ff2b3 commit b180b75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions dist/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Magnific Popup - v0.9.9 - 2013-11-15
/*! Magnific Popup - v0.9.9 - 2013-11-25
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2013 Dmitry Semenov; */
;(function($) {
Expand Down Expand Up @@ -1331,8 +1331,12 @@ $.magnificPopup.registerModule('image', {
if(el.is('img')) {
item.img = item.img.clone();
}
if(item.img[0].naturalWidth > 0) {

img = item.img[0];
if(img.naturalWidth > 0) {
item.hasSize = true;
} else if(!img.width) {
item.hasSize = false;
}
}

Expand Down
Loading

0 comments on commit b180b75

Please sign in to comment.