mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
49 lines
975 B
JavaScript
49 lines
975 B
JavaScript
function atPanelLink (scope, el, attrs, controllers) {
|
|
let panelController = controllers[0];
|
|
|
|
panelController.init(scope, el);
|
|
}
|
|
|
|
function AtPanelController ($state) {
|
|
let vm = this;
|
|
|
|
let scope;
|
|
let el;
|
|
|
|
vm.init = (_scope_, _el_) => {
|
|
scope = _scope_;
|
|
el = _el_;
|
|
};
|
|
|
|
vm.dismiss = () => {
|
|
$state.go(scope.onDismiss || '^');
|
|
};
|
|
|
|
vm.use = child => {
|
|
child.dismiss = vm.dismiss;
|
|
};
|
|
}
|
|
|
|
AtPanelController.$inject = ['$state'];
|
|
|
|
function atPanel (pathService, _$animate_) {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
require: ['atPanel'],
|
|
transclude: true,
|
|
templateUrl: pathService.getPartialPath('components/panel/panel'),
|
|
controller: AtPanelController,
|
|
controllerAs: 'vm',
|
|
link: atPanelLink,
|
|
scope: {
|
|
state: '=',
|
|
onDismiss: '@'
|
|
}
|
|
};
|
|
}
|
|
|
|
atPanel.$inject = ['PathService'];
|
|
|
|
export default atPanel;
|