mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-11 02:21:48 -05:00
51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
const templateUrl = require('~components/tabs/tab.partial.html');
|
|
|
|
function atTabLink (scope, el, attrs, controllers) {
|
|
const groupController = controllers[0];
|
|
const tabController = controllers[1];
|
|
|
|
tabController.init(scope, groupController);
|
|
}
|
|
|
|
function AtTabController ($state) {
|
|
const vm = this;
|
|
|
|
let scope;
|
|
let group;
|
|
|
|
vm.init = (_scope_, _group_) => {
|
|
scope = _scope_;
|
|
group = _group_;
|
|
|
|
group.register(scope);
|
|
};
|
|
|
|
vm.go = () => {
|
|
if (scope.state._disabled || scope.state._active) {
|
|
return;
|
|
}
|
|
|
|
$state.go(scope.state._go, scope.state._params, { reload: true });
|
|
};
|
|
}
|
|
|
|
AtTabController.$inject = ['$state'];
|
|
|
|
function atTab () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
transclude: true,
|
|
require: ['^^atTabGroup', 'atTab'],
|
|
templateUrl,
|
|
controller: AtTabController,
|
|
controllerAs: 'vm',
|
|
link: atTabLink,
|
|
scope: {
|
|
state: '='
|
|
}
|
|
};
|
|
}
|
|
|
|
export default atTab;
|