-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesnt work with embercli with ember 2.0 #26
Comments
+1 |
I have the same problem. I'm using ember 1.12.0 and ember-cli 1.13.8.
I just realised that this is def. not a good solution. Mainly because data- attributes will always have a static value, and that fact will affect your pictures (height and width) when you open the gallery. |
Please don't do as @dzena's example shows - this is deprecated, breaks the bindings, and prevents updates to your items = [
{
src: 'http://your/photo.jpg',
w: 320,
h: 480,
title: 'fancy pic',
msrc: 'bigger size url'
}
]; Then invoke the component like so: {{#photo-swipe items=items as |item|}}
<img src={{item.src}} alt={{item.title}} />
{{/photo-swipe}} For most of us, this will mean mapping your model properties into the PhotoSwipe item structure. |
Oh and here's another thing - the latest published version "ember-cli-photoswipe": "poetic/ember-cli-photoswipe#master" |
@davidgoli items: Ember.computed("model.product.pictures.[]", function () {
var pictures = this.get("model.product.pictures");
var items = [];
pictures.forEach(function (picture) {
var item = {
src: picture.get("readUrl"),
w: 320,
h: 480,
title: picture.get("fileName"),
msrc: "bigger"
};
items.push(item);
});
return items;
}), {{#photo-swipe items=items as |item|}}
<img class="thumb" src={{item.src}} alt={{item.title}} />
{{/photo-swipe}} |
@dzena what version of |
|
I just published |
I created items on model on route and used the {{photoswipe}} as in this dummy app but nothing renders and no error is given
The text was updated successfully, but these errors were encountered: