Where communities thrive
Join over
1.5M+ people
Join over
100K+ communities
Free
without limits
Create
your own community
Explore more communities
rnmp/salvattore
A jQuery Masonry alternative with CSS-driven configuration.
People
Repo info
Activity
emma-uxrepublic
@emma-uxrepublic
i couldn't find nothing on the demo
Joel Glovacki
@saetia
do you mean you want to initialize it after a specific event?
emma-uxrepublic
@emma-uxrepublic
i want it to work in my angular call
so i need to be able to initialize it in my script
as it is now, salvattore is loading itself
it's called in html document
it's executing autamatically by default right ?
is it possible to execute it when i want ?
Joel Glovacki
@saetia
@emma-uxrepublic
$('#grid').html(photos.join(''));
salvattore.registerGrid($('#grid')[0]);
if you're adding photos from an ajax call, that's what works for me
emma-uxrepublic
@emma-uxrepublic
I'm not adding photos at all =)
just using it on some list items
=)
so you say I just need to call registrerGrid function ?
that's all ?
Joel Glovacki
@saetia
but they are added dynamically?
emma-uxrepublic
@emma-uxrepublic
they will be from a Json file
Joel Glovacki
@saetia
yeah, then you'll need to replace the html of your container div with the new content before calling registerGrid on it
or it will keep around the empty columns that are created when you initialize an empty grid
emma-uxrepublic
@emma-uxrepublic
so I still need to call salvattore.js on my hmtl file
then in my script I should call registrerGrid()
and that's it, it will load even with angular ?
Ok i'll be careful to replace the container
Joel Glovacki
@saetia
yeah, because when you add the data-columns attribute to your source file, sal.js will automatically do its thing
_
emma-uxrepublic
@emma-uxrepublic
OK
I'll try this
thank you a lot for your help
Joel Glovacki
@saetia
also make sure that you have your media queries in a .css file or they won't work
emma-uxrepublic
@emma-uxrepublic
my mediaqueries worked very well before passing the project in angular
Joel Glovacki
@saetia
meaning, don't have them inline in a <style> block
emma-uxrepublic
@emma-uxrepublic
so I guess it will still work
Oh yes of course
this is a very bad practice ^^
=)
Good to have that chat
thanks again ^^
I'll tell you if it worked
emma-uxrepublic
@emma-uxrepublic
hello
So I've tried to call it like you said but it's not working
emma-uxrepublic
@emma-uxrepublic
It's partially working in fact
salvottore.registerGrid($('.grid)[0]);
salvattore is generating it's class well
but my content is not here
maybe I've forgotten something
Do you have an idea please ?
emma-uxrepublic
@emma-uxrepublic
you were talking about empty columns yesterday
I have that exact problem
but you are talking about "adding the new content"
what's "NEW" content ? I don't understand
I'm trying to initialize salvattore for the first time in my html page