1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00
OpenSTF/res/app/components/stf/device-context-menu/device-context-menu-directive.js
2016-01-19 23:08:33 +09:00

26 lines
620 B
JavaScript

module.exports = function deviceContextMenuDirective($window) {
return {
restrict: 'EA',
replace: false,
//scope: {
// control: '&',
// device: '&'
//},
transclude: true,
template: require('./device-context-menu.jade'),
link: function(scope) {
//var device = scope.device()
//var control = scope.control()
scope.windowClose = function() {
$window.close()
}
scope.saveScreenShot = function() {
scope.control.screenshot().then(function(result) {
location.href = result.body.href + '?download'
})
}
}
}
}