Closed druellan closed 8 years ago
Thanks for your interest. Two reasons:
reloadItems
deals with items specifically. A better solution would be to add a method that does what you're looking for, perhaps reloadContent
Outlayer.prototype.reloadContent = function() {
// collection of item elements
this.reloadItems();
// elements that affect layout, but are not laid out
this.stamps = [];
this.stamp( this.options.stamp );
};
Thanks for the reply.
Yes, my problem is that this.stamp( this.options.stamp );
it is only called from Outlayer.prototype._create
. So, if you are adding new "stamped" items on Packery for example, you need to use addItems
or appended
methods, otherwise new stamped items are not recognized.
Thats OK BUT, I'm relying on `reloadItems' just because I need to maintain a custom order for the items, so, it is much easier to just layout the bricks and call ´reloadItems´. I don't know if that makes sense.
I'm going to implement reloadContent as you suggest.
BTW, I'm also working on a new item property, "locked". The idea is to have an item that flow with the layout, but has some restrictions. For example, can't be dragged and can't be displaced if you drag another item over it.
Thanks again!
Sounds interesting. I'd love to see the results and how you're putting Outlayer to use
Thanks! I have dirty hack working, but I want to implement this into Outlayer and Packery's source to allow other users to use/fork or patch the code, since it looks that a couple of devs already asked for something like this.
Not sure if this is a bug or workflow decision, but when you reinitialize the items with Outlayer.prototype.reloadItems, new stamped items are not refreshed.
Why is not implemented this way?