[www] Gallery page updated

This commit is contained in:
Roman Timashev committed 2017-09-18 00:46:51 +03:00
1 parent 6fa8564cc8
commit 597e87896e
6 files changed
+75 -38

No files matched your search

+21
View File
@@ -1,4 +1,5 @@
const Data = require('./Data')
const ImageArtifactType = require('./ImageArtifactType')
const {findOne} = require('../lib/store')
const {mapOf} = require('../lib/common')
@@ -32,6 +33,26 @@ class Image {
return null
}
getPicture(size) {
const retinaSize = ImageArtifactType.retina(size)
const a = this.getArtifact(size)
const a2 = this.getArtifact(retinaSize)
const pic = {
src: a.url,
width: a.width,
height: a.height,
set: [
{
url: a2.url,
density: ImageArtifactType.RETINA_DENSITY,
}
]
}
console.log(pic)
return pic
}
}
class ImageArtifact {