1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

Clicking the small image on Device List now shows the big device image.

This commit is contained in:
Gunther Brunner 2014-08-04 21:57:49 +09:00
parent feb9b04ebc
commit a7faf0986b
2 changed files with 19 additions and 1 deletions

View file

@ -396,6 +396,7 @@ function DeviceModelCell(options) {
, image = document.createElement('img')
, a = document.createElement('a')
span.className = 'device-small-image'
image.className = 'device-small-image-img pointer'
span.appendChild(image)
td.appendChild(span)
a.appendChild(document.createTextNode(''))

View file

@ -6,6 +6,7 @@ module.exports = function DeviceListDetailsDirective(
, DeviceColumnService
, GroupService
, $rootScope
, LightboxImageService
) {
return {
restrict: 'E'
@ -41,7 +42,7 @@ module.exports = function DeviceListDetailsDirective(
})
}
element.on('click', function (e) {
function checkDeviceStatus (e) {
if (e.target.classList.contains('device-status')) {
var id = e.target.parentNode.parentNode.id
var device = mapping[id]
@ -60,6 +61,22 @@ module.exports = function DeviceListDetailsDirective(
e.preventDefault()
}
}
}
function checkDeviceSmallImage(e) {
if (e.target.classList.contains('device-small-image-img')) {
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)
}
}
element.on('click', function (e) {
checkDeviceStatus(e)
checkDeviceSmallImage(e)
})
// Import column definitions