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/common-ui/fatal-message/fatal-message-service.js
2014-05-13 19:22:23 +09:00

41 lines
981 B
JavaScript

module.exports = function FatalMessageServiceFactory($modal, $location, $route) {
var FatalMessageService = {}
var ModalInstanceCtrl = function ($scope, $modalInstance, device) {
$scope.ok = function () {
$modalInstance.close(5)
$route.reload()
//$location.path('/control/' + device.serial)
}
$scope.second = function () {
$location.path('/devices/')
}
$scope.cancel = function () {
$modalInstance.dismiss('cancel')
}
}
FatalMessageService.open = function (device) {
var modalInstance = $modal.open({
template: require('./fatal-message.jade'),
controller: ModalInstanceCtrl,
resolve: {
device: device,
items: function () {
return 10
}
}
})
modalInstance.result.then(function (selectedItem) {
console.log(selectedItem)
}, function () {
console.log('Modal dismissed at: ' + new Date())
})
}
return FatalMessageService
}