Comments (8)
+1
from ember-cli-photoswipe.
I have the same problem. I'm using ember 1.12.0 and ember-cli 1.13.8.
Solve the problem in the following way though:
{{#photo-swipe}}
{{#each model.product.pictures as |img|}}
<a class="photo-item" href={{img.readUrl}} data-width="100" data-height="100">
<img src={{img.readUrl}} width="100" height="100" alt={{img.fileName}}>
</a>
{{/each}}
{{/photo-swipe}}
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.
from ember-cli-photoswipe.
Please don't do as @dzena's example shows - this is deprecated, breaks the bindings, and prevents updates to your model
from being reflected in the slideshow. Instead, make sure your items are structured as follows:
items = [
{
src: 'http://your/photo.jpg',
w: 320,
h: 480,
title: 'fancy pic',
msrc: 'bigger size url'
}
];
Then invoke the component like so:
For most of us, this will mean mapping your model properties into the PhotoSwipe item structure.
from ember-cli-photoswipe.
Oh and here's another thing - the latest published version 1.1.0
is not using the same code as you see on the master
branch; it's a few commits behind and doesn't work with the README
you see here. Hopefully the maintainers of this addon will wake up from their deep deep sleep and publish a new version with what they have here in master. Until then, you can pin in package.json
:
"ember-cli-photoswipe": "poetic/ember-cli-photoswipe#master"
from ember-cli-photoswipe.
@davidgoli
I still have the same problem. Nothing is being rendered.
ember-cli: 1.13.8
ember: 1.12.0
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;
}),
from ember-cli-photoswipe.
@dzena what version of ember-cli-photoswipe
are you running?
from ember-cli-photoswipe.
"ember-cli-photoswipe": "poetic/ember-cli-photoswipe#master"
from ember-cli-photoswipe.
I just published 1.2.0
to npm so you should once again be able to point to that version now for this functionality.
from ember-cli-photoswipe.
Related Issues (20)
- Update readme / package be compatible with `install:addon` HOT 2
- Update version of photoswipe HOT 1
- Code coverage HOT 2
- Add ability to pass options into the component HOT 1
- Cannot convert a Symbol value to a string HOT 9
- Update addon's ember-cli release HOT 1
- generator needs to run every time the bower_components dir is cleared.
- element index is not being passed to photoswipe click method HOT 3
- Adding support for use with ember-wormhole HOT 14
- Programmatically update when items change
- Uncaught TypeError: Cannot assign to read only property 'initialLayout' of false HOT 9
- Addon does not work as advertised HOT 7
- How to configure Ui HOT 1
- error: "event listener's handler isn't a function or empty" HOT 1
- Using ember-cli-photoswipe without an 'items' attribute is deprecated. HOT 1
- Empty src causes component crash
- Possible to make specific sections clickable?
- msrc attribute is not working
- User PhotoSwipe NPM package instead of Bower
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-photoswipe.