mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -03:30
Merge pull request #339 from gconsidine/ui/fix/document-reference-on-start
Use $document instead of document for on fn
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
const templateUrl = require('~components/layout/side-nav.partial.html');
|
const templateUrl = require('~components/layout/side-nav.partial.html');
|
||||||
|
|
||||||
|
let $document;
|
||||||
|
|
||||||
function atSideNavLink (scope, element, attrs, ctrl) {
|
function atSideNavLink (scope, element, attrs, ctrl) {
|
||||||
scope.layoutVm = ctrl;
|
scope.layoutVm = ctrl;
|
||||||
|
|
||||||
document.on('click', (e) => {
|
$document.on('click', (e) => {
|
||||||
if ($(e.target).parents('.at-Layout-side').length === 0) {
|
if ($(e.target).parents('.at-Layout-side').length === 0) {
|
||||||
scope.$emit('clickOutsideSideNav');
|
scope.$emit('clickOutsideSideNav');
|
||||||
}
|
}
|
||||||
@@ -35,7 +37,9 @@ function AtSideNavController ($scope, $window) {
|
|||||||
|
|
||||||
AtSideNavController.$inject = ['$scope', '$window'];
|
AtSideNavController.$inject = ['$scope', '$window'];
|
||||||
|
|
||||||
function atSideNav () {
|
function atSideNav (_$document_) {
|
||||||
|
$document = _$document_;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
replace: true,
|
replace: true,
|
||||||
@@ -50,4 +54,6 @@ function atSideNav () {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atSideNav.$inject = ['$document'];
|
||||||
|
|
||||||
export default atSideNav;
|
export default atSideNav;
|
||||||
|
|||||||
Reference in New Issue
Block a user