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:
Greg Considine 2017-10-02 13:34:27 -04:00 committed by GitHub
commit e7f4e79248

View File

@ -1,9 +1,11 @@
const templateUrl = require('~components/layout/side-nav.partial.html');
let $document;
function atSideNavLink (scope, element, attrs, ctrl) {
scope.layoutVm = ctrl;
document.on('click', (e) => {
$document.on('click', (e) => {
if ($(e.target).parents('.at-Layout-side').length === 0) {
scope.$emit('clickOutsideSideNav');
}
@ -35,7 +37,9 @@ function AtSideNavController ($scope, $window) {
AtSideNavController.$inject = ['$scope', '$window'];
function atSideNav () {
function atSideNav (_$document_) {
$document = _$document_;
return {
restrict: 'E',
replace: true,
@ -50,4 +54,6 @@ function atSideNav () {
};
}
atSideNav.$inject = ['$document'];
export default atSideNav;