Files
stf-DeviceFarmer/res/app/components/stf/common-ui/modals/external-url-modal/external-url-modal-service.js
Gunther Brunner b8b293d18a Update bower dependencies.
Update to latest bootstrap-ui 1.0.3.
Change Wifi settings button and behaviour of several tooltips accordingly.
Remove collapse elements since the animation breaks.
2016-01-14 20:48:38 +09:00

43 lines
944 B
JavaScript

module.exports = function ServiceFactory($uibModal, $sce) {
var service = {}
var ModalInstanceCtrl = function ($scope, $uibModalInstance, url, title, icon) {
$scope.ok = function () {
$uibModalInstance.close(true)
}
$scope.url = $sce.trustAsResourceUrl(url)
$scope.title = title
$scope.icon = icon
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel')
}
}
service.open = function (url, title, icon) {
var modalInstance = $uibModal.open({
template: require('./external-url-modal.jade'),
controller: ModalInstanceCtrl,
windowClass: 'modal-size-80p',
resolve: {
title: function() {
return title
},
url: function () {
return url
},
icon: function () {
return icon
}
}
})
modalInstance.result.then(function () {
}, function () {
})
}
return service
}