Open halfcab123 opened 7 years ago
anyone ?
@halfcab123 For your question:
$('.waterfall').waterfall('destroy');
$('.waterfall').data('bootstrap-waterfall-template', $('#waterfall-template').html()) // $('#waterfall-template').html() can be any markups from anywhere
$('.waterfall').waterfall()
Really sorry for the late reply~
I'm pre-rendering a template on the server with nodejs that gets sent dynamically, so the html is already existent in the div when I run .waterfall
I might as well just ask, how to do with static html and no template.
@halfcab123 We can tell the whole logic from source code:
https://github.com/Mystist/bootstrap-waterfall/blob/master/src/bootstrap-waterfall.js#L122
var $elements = this.$element.children().length > 0 ? this.$element.children().remove() : $(this.$element.data('bootstrap-waterfall-template'))
It will get all the pin's markups from:
You can choose each one of them.
BTW, different from some of the other waterfall plugin, which are take more cares of the use cases for the end user and add more functionality and make it more fancy, bootstrap-waterfall
will take more care of the developers.
The idea is to write well structured and easy to understood codes for the developers, then they can fork it and customize it and make it fit their special use cases.
So, if you are interested in the source code, play with it and have fun!
Happy coding 🤣
Thank you so much for taking the time to reply :)
[image: PerfectRoot] http://www.perfectroot.com/
Christopher Ridgeway / COO chris@perfectroot.com / (757)-215-6346
PerfectRoot http://www.perfectroot.com
On Wed, May 31, 2017 at 10:31 PM, Mystist notifications@github.com wrote:
@halfcab123 https://github.com/halfcab123 We can tell the whole logic from source code: https://github.com/Mystist/bootstrap-waterfall/blob/master/src/bootstrap- waterfall.js#L122 var $elements = this.$element.children().length > 0 ? this.$element.children().remove() : $(this.$element.data(' bootstrap-waterfall-template'))
It will get all the pin's markups from:
- The div container's children, if only the container has children
- The container's data object
You can choose each one of them.
BTW, different from some of the other waterfall plugin, which are take more cares of the use cases for the end user and add more functionality and make it more fancy, bootstrap-waterfall will take more care of the developers. The idea is to write well structured and easy to understood codes for the developers, then they can fork it and customize it and make it fit their special use cases.
So, if you are interested in the source code, play with it and have fun!
Happy coding 🤣
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Mystist/bootstrap-waterfall/issues/7#issuecomment-305372051, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNqxate6FZ0occ4Pfauz5aSANtdXx0-ks5r_iJugaJpZM4NcrtE .
I would like to be able to remove pins from
And once they are removed, re-run waterfall() to reorganize the remaining pins into a waterfall.Is this currently possible?
Re-running waterfall() just seems to cause issues, and I am not really able to remove pins successfully.