mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
45 lines
1 KiB
JavaScript
45 lines
1 KiB
JavaScript
module.exports =
|
|
function AddAdbKeyModalServiceFactory($modal) {
|
|
var service = {}
|
|
|
|
var ModalInstanceCtrl = function ($scope, $modalInstance, data) {
|
|
$scope.modal = {}
|
|
$scope.modal.showAdd = true
|
|
$scope.modal.fingerprint = data.fingerprint
|
|
$scope.modal.title = data.title
|
|
|
|
$scope.ok = function () {
|
|
console.log('add key')
|
|
$modalInstance.close(true)
|
|
}
|
|
|
|
|
|
$scope.$watch('modal.showAdd', function (newValue) {
|
|
if (newValue === false) {
|
|
$scope.ok()
|
|
}
|
|
})
|
|
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel')
|
|
}
|
|
}
|
|
|
|
service.open = function (data) {
|
|
var modalInstance = $modal.open({
|
|
template: require('./add-adb-key-modal.jade'),
|
|
controller: ModalInstanceCtrl,
|
|
resolve: {
|
|
data: function () {
|
|
return data
|
|
}
|
|
}
|
|
})
|
|
|
|
modalInstance.result.then(function () {
|
|
}, function () {
|
|
})
|
|
}
|
|
|
|
return service
|
|
}
|