DrewDahlman / Mason

Mason.js for creating a perfect grid with jQuery.
http://masonjs.com/
MIT License
1.22k stars 184 forks source link

Filler blocks don't get used when using 'promoted'... #24

Closed Kurve closed 9 years ago

Kurve commented 10 years ago

Hi,

Just started using mason.js and I have an issue.

I have added a classes to a div so I can specify the column / row span using the 'promoted' aspect. When I do, the fillers stop working.

I have stripped this back to your demo and they also fail.

Kurve commented 10 years ago

I have delved further.

Would I be right in thinking you only allow 2 configurations in the 'promoted' options?

As whenever I add more than 2 for example:

promoted: [ [1,2, 'tile1x2'], [2,1, 'tile2x1'], [2,2, 'tile2x2'], //After I add this it goes wrong [2,3, 'tile2x3'], [3,2, 'tile3x2'], [2,4, 'tile2x4'], [4,2, 'tile4x2'], ],

DrewDahlman commented 10 years ago

my first suggestion is to remove the trailing , from your promoted - [1,2, 'tile1x2'], [2,1, 'tile2x1'], [2,2, 'tile2x2'], //After I add this it goes wrong [2,3, 'tile2x3'], [3,2, 'tile3x2'], [2,4, 'tile2x4'], [4,2, 'tile4x2'] ],

also can you provide a jsfiddle?

Kurve commented 10 years ago

Hi,

Thanks for the response I'll check my code. Failing that I'll upload a jsfiddle.

Kurve commented 10 years ago

Hi,

Still struggling with this.

Here is a link to my fiddle http://jsfiddle.net/Kurve/h2VGE/7/

A prompt response would be greatly appreciated, cheers.

Kurve commented 10 years ago

HI,

It seems to be an issue with this $self.children(settings.itemSelector).each(function ()

Where the following are undefined:

var h = settings.sizes[s][1]; var w = settings.sizes[s][0];

Kurve commented 10 years ago

Managed to download a different version of mason.js from one of your old fiddles. Seems fine now. Just have an issue with duplicate fillers as it repeats them.