Skip to content

Commit

Permalink
Display is no longer set if item is invisible.
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Nov 17, 2012
1 parent f7cd13d commit 8c84aec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions jquery.freetile.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,28 @@
});
},

prepareElements: function(container, elements, o) // Container, elements, options
{
// Set elements display to block (http://jsfiddle.net/vH2g9/1/)
// and position to absolute first. (http://bit.ly/hpo7Nv)
elements.each(function()
{
var $this = $(this);
if ($this.is(':visible'))
{
$this.css({'display' : 'block'});
}
}).css({'position' : 'absolute'});
},

// Process styleQueue
// This is set up like jQuery masonry, rather than directly applying
// styles in the positioning loop. For some reason, it yields a performance gain
// of about 7x (in Safari 5.1.4)!!
// _________________________________________________________

applyStyles : function(o) {
applyStyles : function(o)
{
var obj;
for (var i=0, len = o.styleQueue.length; i < len; i++)
{
Expand Down Expand Up @@ -463,9 +478,7 @@
// 2. Position Elements and apply styles.
//

// Set elements display to block (http://jsfiddle.net/vH2g9/1/)
// and position to absolute first. (http://bit.ly/hpo7Nv)
Elements.css({'display' : 'block', 'position' : 'absolute'});
Freetile.prepareElements(container, Elements, o);
Freetile.calculatePositions(container, Elements, o);
Freetile.applyStyles(o);

Expand Down
2 changes: 1 addition & 1 deletion jquery.freetile.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c84aec

Please sign in to comment.