Don't open modal box if it doesn't have a big photo.

This commit is contained in:
Gunther Brunner
2014-09-12 19:32:35 +09:00
parent a4a46fc48b
commit bd7035c670
2 changed files with 9 additions and 4 deletions

View File

@@ -68,9 +68,11 @@ module.exports = function DeviceListDetailsDirective(
var id = e.target.parentNode.parentNode.parentNode.id
var device = mapping[id]
var title = device.name
var enhancedPhoto800 = '/static/app/devices/photo/x800/' + device.image
LightboxImageService.open(title, enhancedPhoto800)
if (device.name && device.image) {
var title = device.name
var enhancedPhoto800 = '/static/app/devices/photo/x800/' + device.image
LightboxImageService.open(title, enhancedPhoto800)
}
}
}