diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index 31f683c..d15697b 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -1,17 +1,18 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('appHeader', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('appHeader', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./app-header.html'),
-        'scope': {
-          'path': '='
-        },
-        'controller': ['$rootScope', '$scope', 'dataService', 'userModel', '$location', '$route',
-          function($rootScope, $scope, dataService, userModel, $location, $route) {
+        'scope': {'path': '='},
+        'controller': [
+          '$rootScope', '$scope', 'dataService', 'userModel', '$location',
+          '$route',
+          function(
+              $rootScope, $scope, dataService, userModel, $location, $route) {
             $scope.dataService = dataService;
 
             $scope.loadServerHealth = function() {
@@ -24,19 +25,22 @@
               if (!userModel.isLoggedIn()) {
                 return;
               }
-              APIUtils.getHostState().then(function(status) {
-                if (status == 'xyz.openbmc_project.State.Host.HostState.Off') {
-                  dataService.setPowerOffState();
-                }
-                else if (status == 'xyz.openbmc_project.State.Host.HostState.Running') {
-                  dataService.setPowerOnState();
-                }
-                else {
-                  dataService.setErrorState();
-                }
-              }, function(error) {
-                dataService.activateErrorModal();
-              });
+              APIUtils.getHostState().then(
+                  function(status) {
+                    if (status ==
+                        'xyz.openbmc_project.State.Host.HostState.Off') {
+                      dataService.setPowerOffState();
+                    } else if (
+                        status ==
+                        'xyz.openbmc_project.State.Host.HostState.Running') {
+                      dataService.setPowerOnState();
+                    } else {
+                      dataService.setErrorState();
+                    }
+                  },
+                  function(error) {
+                    dataService.activateErrorModal();
+                  });
             };
 
             $scope.loadNetworkInfo = function() {
@@ -60,19 +64,19 @@
               userModel.logout(function(status, error) {
                 if (status) {
                   $location.path('/logout');
-                }
-                else {
+                } else {
                   console.log(error);
                 }
               });
             };
 
             $scope.refresh = function() {
-              //reload current page controllers and header
+              // reload current page controllers and header
               loadData();
               $route.reload();
-              //Add flash class to header timestamp on click of refresh
-              var myEl = angular.element(document.querySelector('.header__refresh'));
+              // Add flash class to header timestamp on click of refresh
+              var myEl =
+                  angular.element(document.querySelector('.header__refresh'));
               myEl.addClass('flash');
               setTimeout(function() {
                 myEl.removeClass('flash');
@@ -80,9 +84,10 @@
 
             };
 
-            var loginListener = $rootScope.$on('user-logged-in', function(event, arg) {
-              loadData();
-            });
+            var loginListener =
+                $rootScope.$on('user-logged-in', function(event, arg) {
+                  loadData();
+                });
 
             $scope.$on('$destroy', function() {
               loginListener();
@@ -94,5 +99,6 @@
           }
         ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/app-navigation.js b/app/common/directives/app-navigation.js
index 80d09ec..c1272de 100644
--- a/app/common/directives/app-navigation.js
+++ b/app/common/directives/app-navigation.js
@@ -1,75 +1,67 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('appNavigation', function() {
-      return {
-        'restrict': 'E',
-        'template': require('./app-navigation.html'),
-        'scope': {
-          'path': '=',
-          'showNavigation': '='
-        },
-        'controller': ['$scope', '$location', 'dataService', function($scope, $location, dataService) {
-          $scope.dataService = dataService;
-          $scope.showSubMenu = false;
-          $scope.change = function(firstLevel) {
-            if (firstLevel != $scope.firstLevel) {
-              $scope.firstLevel = firstLevel;
-              $scope.showSubMenu = true;
-            }
-            else {
-              $scope.showSubMenu = !$scope.showSubMenu;
-            }
-          };
-          $scope.closeSubnav = function() {
-            $scope.showSubMenu = false;
-          };
-          $scope.$watch('path', function() {
-            var urlRoot = $location.path().split('/')[1];
-            if (urlRoot != '') {
-              $scope.firstLevel = urlRoot;
-            }
-            else {
-              $scope.firstLevel = 'overview';
-            }
-            $scope.showSubMenu = false;
-          });
-          $scope.$watch('showNavigation', function() {
-            var paddingTop = 0;
-            var urlRoot = $location.path().split('/')[1];
-            if (urlRoot != '') {
-              $scope.firstLevel = urlRoot;
-            }
-            else {
-              $scope.firstLevel = 'overview';
-            }
+  angular.module('app.common.directives')
+      .directive('appNavigation', function() {
+        return {
+          'restrict': 'E',
+          'template': require('./app-navigation.html'),
+          'scope': {'path': '=', 'showNavigation': '='},
+          'controller': [
+            '$scope', '$location', 'dataService',
+            function($scope, $location, dataService) {
+              $scope.dataService = dataService;
+              $scope.showSubMenu = false;
+              $scope.change = function(firstLevel) {
+                if (firstLevel != $scope.firstLevel) {
+                  $scope.firstLevel = firstLevel;
+                  $scope.showSubMenu = true;
+                } else {
+                  $scope.showSubMenu = !$scope.showSubMenu;
+                }
+              };
+              $scope.closeSubnav = function() {
+                $scope.showSubMenu = false;
+              };
+              $scope.$watch('path', function() {
+                var urlRoot = $location.path().split('/')[1];
+                if (urlRoot != '') {
+                  $scope.firstLevel = urlRoot;
+                } else {
+                  $scope.firstLevel = 'overview';
+                }
+                $scope.showSubMenu = false;
+              });
+              $scope.$watch('showNavigation', function() {
+                var paddingTop = 0;
+                var urlRoot = $location.path().split('/')[1];
+                if (urlRoot != '') {
+                  $scope.firstLevel = urlRoot;
+                } else {
+                  $scope.firstLevel = 'overview';
+                }
 
-            if ($scope.showNavigation) {
-              paddingTop = document.getElementById('header__wrapper').offsetHeight;
-            }
-            dataService.bodyStyle = {
-              'padding-top': paddingTop + 'px'
-            };
-            $scope.navStyle = {
-              'top': paddingTop + 'px'
-            };
-          });
-        }],
-        link: function(scope, element, attributes) {
-          var rawNavElement = angular.element(element)[0];
-          angular.element(window.document).bind('click', function(event) {
-            if (rawNavElement.contains(event.target))
-              return;
-
-            if (scope.showSubMenu) {
-              scope.$apply(function() {
-                scope.showSubMenu = false;
+                if ($scope.showNavigation) {
+                  paddingTop =
+                      document.getElementById('header__wrapper').offsetHeight;
+                }
+                dataService.bodyStyle = {'padding-top': paddingTop + 'px'};
+                $scope.navStyle = {'top': paddingTop + 'px'};
               });
             }
-          });
-        }
-      };
-    });
+          ],
+          link: function(scope, element, attributes) {
+            var rawNavElement = angular.element(element)[0];
+            angular.element(window.document).bind('click', function(event) {
+              if (rawNavElement.contains(event.target)) return;
+
+              if (scope.showSubMenu) {
+                scope.$apply(function() {
+                  scope.showSubMenu = false;
+                });
+              }
+            });
+          }
+        };
+      });
 })(window.angular);
diff --git a/app/common/directives/confirm.js b/app/common/directives/confirm.js
index a542783..b537905 100644
--- a/app/common/directives/confirm.js
+++ b/app/common/directives/confirm.js
@@ -1,44 +1,42 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('confirm', ['$timeout', function($timeout) {
+  angular.module('app.common.directives').directive('confirm', [
+    '$timeout',
+    function($timeout) {
       return {
         'restrict': 'E',
         'template': require('./confirm.html'),
-        'scope': {
-          'title': '@',
-          'message': '@',
-          'confirm': '=',
-          'callback': '='
-        },
-        'controller': ['$scope', function($scope) {
-          $scope.cancel = function() {
-            $scope.confirm = false;
-            $scope.$parent.confirm = false;
-          };
-          $scope.accept = function() {
-            $scope.callback();
-            $scope.cancel();
-          };
-        }],
+        'scope':
+            {'title': '@', 'message': '@', 'confirm': '=', 'callback': '='},
+        'controller': [
+          '$scope',
+          function($scope) {
+            $scope.cancel = function() {
+              $scope.confirm = false;
+              $scope.$parent.confirm = false;
+            };
+            $scope.accept = function() {
+              $scope.callback();
+              $scope.cancel();
+            };
+          }
+        ],
         link: function(scope, e) {
           scope.$watch('confirm', function() {
             if (scope.confirm) {
               $timeout(function() {
                 angular.element(e[0].parentNode).css({
-                  'min-height': e[0].querySelector('.inline__confirm').offsetHeight + 'px'
+                  'min-height':
+                      e[0].querySelector('.inline__confirm').offsetHeight + 'px'
                 });
               }, 0);
-            }
-            else {
-              angular.element(e[0].parentNode).css({
-                'min-height': 0 + 'px'
-              });
+            } else {
+              angular.element(e[0].parentNode).css({'min-height': 0 + 'px'});
             }
           });
         }
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/errors.js b/app/common/directives/errors.js
index 8123694..5bd1e52 100644
--- a/app/common/directives/errors.js
+++ b/app/common/directives/errors.js
@@ -1,18 +1,20 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('errors', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('errors', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./errors.html'),
-        'scope': {
-          'path': '='
-        },
-        'controller': ['$scope', 'dataService', function($scope, dataService) {
-          $scope.dataService = dataService;
-        }]
+        'scope': {'path': '='},
+        'controller': [
+          '$scope', 'dataService',
+          function($scope, dataService) {
+            $scope.dataService = dataService;
+          }
+        ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/file.js b/app/common/directives/file.js
index 8ed6c2e..b0f5289 100644
--- a/app/common/directives/file.js
+++ b/app/common/directives/file.js
@@ -1,21 +1,17 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('file', function() {
-      return {
-        scope: {
-          file: '='
-        },
-        link: function(scope, el, attrs) {
-          el.bind('change', function(event) {
-            var file = event.target.files[0];
-            scope.file = file ? file : undefined;
-            scope.$apply();
-          });
-        }
-      };
-    });
+  angular.module('app.common.directives').directive('file', function() {
+    return {
+      scope: {file: '='},
+      link: function(scope, el, attrs) {
+        el.bind('change', function(event) {
+          var file = event.target.files[0];
+          scope.file = file ? file : undefined;
+          scope.$apply();
+        });
+      }
+    };
+  });
 
 })(window.angular);
diff --git a/app/common/directives/firmware-list.js b/app/common/directives/firmware-list.js
index 163df82..a08ef8d 100644
--- a/app/common/directives/firmware-list.js
+++ b/app/common/directives/firmware-list.js
@@ -1,32 +1,32 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('firmwareList', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('firmwareList', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./firmware-list.html'),
-        'scope': {
-          'title': '@',
-          'firmwares': '=',
-          'filterBy': '=',
-          'version': '='
-        },
-        'controller': ['$rootScope', '$scope', 'dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout) {
-          $scope.dataService = dataService;
-          $scope.activate = function(imageId, imageVersion, imageType) {
-            $scope.$parent.activateImage(imageId, imageVersion, imageType);
-          };
+        'scope':
+            {'title': '@', 'firmwares': '=', 'filterBy': '=', 'version': '='},
+        'controller': [
+          '$rootScope', '$scope', 'dataService', '$location', '$timeout',
+          function($rootScope, $scope, dataService, $location, $timeout) {
+            $scope.dataService = dataService;
+            $scope.activate = function(imageId, imageVersion, imageType) {
+              $scope.$parent.activateImage(imageId, imageVersion, imageType);
+            };
 
-          $scope.delete = function(imageId, imageVersion) {
-            $scope.$parent.deleteImage(imageId, imageVersion);
-          };
+            $scope.delete = function(imageId, imageVersion) {
+              $scope.$parent.deleteImage(imageId, imageVersion);
+            };
 
-          $scope.changePriority = function(imageId, imageVersion, from, to) {
-            $scope.$parent.changePriority(imageId, imageVersion, from, to);
-          };
-        }]
+            $scope.changePriority = function(imageId, imageVersion, from, to) {
+              $scope.$parent.changePriority(imageId, imageVersion, from, to);
+            };
+          }
+        ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/index.js b/app/common/directives/index.js
index 33155f4..150b43f 100644
--- a/app/common/directives/index.js
+++ b/app/common/directives/index.js
@@ -1,9 +1,6 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives', [
-      'app.common.services'
-    ]);
+  angular.module('app.common.directives', ['app.common.services']);
 
 })(window.angular);
diff --git a/app/common/directives/loader.js b/app/common/directives/loader.js
index 8edc128..46fba9a 100644
--- a/app/common/directives/loader.js
+++ b/app/common/directives/loader.js
@@ -1,16 +1,12 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('loader', function() {
-      return {
-        'restrict': 'E',
-        'template': require('./loader.html'),
-        scope: {
-          loading: '='
-        }
-      };
-    });
+  angular.module('app.common.directives').directive('loader', function() {
+    return {
+      'restrict': 'E',
+      'template': require('./loader.html'),
+      scope: {loading: '='}
+    };
+  });
 
 })(window.angular);
diff --git a/app/common/directives/log-event.js b/app/common/directives/log-event.js
index c48a3ee..2a71164 100644
--- a/app/common/directives/log-event.js
+++ b/app/common/directives/log-event.js
@@ -1,43 +1,41 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('logEvent', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('logEvent', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./log-event.html'),
-        'scope': {
-          'event': '=',
-          'tmz': '=',
-          'multiSelected': '='
-        },
-        'controller': ['$rootScope', '$scope', 'dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout) {
-          $scope.dataService = dataService;
-          $scope.copySuccess = function(event) {
-            event.copied = true;
-            $timeout(function() {
-              event.copied = false;
-            }, 5000);
-          };
-          $scope.copyFailed = function(err) {
-            console.error('Error!', err);
-          };
-          $scope.resolveEvent = function(event) {
-            APIUtils.resolveLogs([{
-              Id: event.Id
-            }]).then(function() {
-              event.Resolved = 1;
-            });
-          };
+        'scope': {'event': '=', 'tmz': '=', 'multiSelected': '='},
+        'controller': [
+          '$rootScope', '$scope', 'dataService', '$location', '$timeout',
+          function($rootScope, $scope, dataService, $location, $timeout) {
+            $scope.dataService = dataService;
+            $scope.copySuccess = function(event) {
+              event.copied = true;
+              $timeout(function() {
+                event.copied = false;
+              }, 5000);
+            };
+            $scope.copyFailed = function(err) {
+              console.error('Error!', err);
+            };
+            $scope.resolveEvent = function(event) {
+              APIUtils.resolveLogs([{Id: event.Id}]).then(function() {
+                event.Resolved = 1;
+              });
+            };
 
-          $scope.accept = function() {
-            $scope.event.selected = true;
-            $timeout(function() {
-              $scope.$parent.accept();
-            }, 10);
-          };
-        }]
+            $scope.accept = function() {
+              $scope.event.selected = true;
+              $timeout(function() {
+                $scope.$parent.accept();
+              }, 10);
+            };
+          }
+        ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/log-filter.js b/app/common/directives/log-filter.js
index 69bb8e3..fcbe0b3 100644
--- a/app/common/directives/log-filter.js
+++ b/app/common/directives/log-filter.js
@@ -1,51 +1,54 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('logFilter', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('logFilter', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./log-filter.html'),
-        'controller': ['$rootScope', '$scope', 'dataService', '$location', function($rootScope, $scope, dataService, $location) {
-          $scope.dataService = dataService;
-          $scope.toggleSeverityAll = function() {
-            $scope.selectedSeverity.all = !$scope.selectedSeverity.all;
+        'controller': [
+          '$rootScope', '$scope', 'dataService', '$location',
+          function($rootScope, $scope, dataService, $location) {
+            $scope.dataService = dataService;
+            $scope.toggleSeverityAll = function() {
+              $scope.selectedSeverity.all = !$scope.selectedSeverity.all;
 
-            if ($scope.selectedSeverity.all) {
-              $scope.selectedSeverity.low = false;
-              $scope.selectedSeverity.medium = false;
-              $scope.selectedSeverity.high = false;
-            }
-          };
-
-          $scope.toggleSeverity = function(severity) {
-            $scope.selectedSeverity[severity] = !$scope.selectedSeverity[severity];
-
-            if (['high', 'medium', 'low'].indexOf(severity) > -1) {
-              if ($scope.selectedSeverity[severity] == false &&
-                (!$scope.selectedSeverity.low &&
-                  !$scope.selectedSeverity.medium &&
-                  !$scope.selectedSeverity.high
-                )) {
-                $scope.selectedSeverity.all = true;
-                return;
+              if ($scope.selectedSeverity.all) {
+                $scope.selectedSeverity.low = false;
+                $scope.selectedSeverity.medium = false;
+                $scope.selectedSeverity.high = false;
               }
-            }
+            };
 
-            if ($scope.selectedSeverity.low &&
-              $scope.selectedSeverity.medium &&
-              $scope.selectedSeverity.high) {
-              $scope.selectedSeverity.all = true;
-              $scope.selectedSeverity.low = false;
-              $scope.selectedSeverity.medium = false;
-              $scope.selectedSeverity.high = false;
-            }
-            else {
-              $scope.selectedSeverity.all = false;
-            }
-          };
-        }]
+            $scope.toggleSeverity = function(severity) {
+              $scope.selectedSeverity[severity] =
+                  !$scope.selectedSeverity[severity];
+
+              if (['high', 'medium', 'low'].indexOf(severity) > -1) {
+                if ($scope.selectedSeverity[severity] == false &&
+                    (!$scope.selectedSeverity.low &&
+                     !$scope.selectedSeverity.medium &&
+                     !$scope.selectedSeverity.high)) {
+                  $scope.selectedSeverity.all = true;
+                  return;
+                }
+              }
+
+              if ($scope.selectedSeverity.low &&
+                  $scope.selectedSeverity.medium &&
+                  $scope.selectedSeverity.high) {
+                $scope.selectedSeverity.all = true;
+                $scope.selectedSeverity.low = false;
+                $scope.selectedSeverity.medium = false;
+                $scope.selectedSeverity.high = false;
+              } else {
+                $scope.selectedSeverity.all = false;
+              }
+            };
+          }
+        ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/log-search-control.js b/app/common/directives/log-search-control.js
index f262f5f..abdc9ff 100644
--- a/app/common/directives/log-search-control.js
+++ b/app/common/directives/log-search-control.js
@@ -1,46 +1,49 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('logSearchControl', ['APIUtils', function(APIUtils) {
+  angular.module('app.common.directives').directive('logSearchControl', [
+    'APIUtils',
+    function(APIUtils) {
       return {
         'restrict': 'E',
         'template': require('./log-search-control.html'),
-        'controller': ['$rootScope', '$scope', 'dataService', '$location', function($rootScope, $scope, dataService, $location) {
-          $scope.dataService = dataService;
-          $scope.doSearchOnEnter = function(event) {
-            var search = $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, '');
-            if (event.keyCode === 13 &&
-              search.length >= 2) {
-              $scope.clearSearchItem();
-              $scope.addSearchItem(search);
-            }
-            else {
-              if (search.length == 0) {
+        'controller': [
+          '$rootScope', '$scope', 'dataService', '$location',
+          function($rootScope, $scope, dataService, $location) {
+            $scope.dataService = dataService;
+            $scope.doSearchOnEnter = function(event) {
+              var search =
+                  $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, '');
+              if (event.keyCode === 13 && search.length >= 2) {
                 $scope.clearSearchItem();
+                $scope.addSearchItem(search);
+              } else {
+                if (search.length == 0) {
+                  $scope.clearSearchItem();
+                }
               }
-            }
-          };
+            };
 
-          $scope.clear = function() {
-            $scope.customSearch = '';
-            $scope.clearSearchItem();
-          };
-
-          $scope.doSearchOnClick = function() {
-            var search = $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, '');
-            if (search.length >= 2) {
+            $scope.clear = function() {
+              $scope.customSearch = '';
               $scope.clearSearchItem();
-              $scope.addSearchItem(search);
-            }
-            else {
-              if (search.length == 0) {
+            };
+
+            $scope.doSearchOnClick = function() {
+              var search =
+                  $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, '');
+              if (search.length >= 2) {
                 $scope.clearSearchItem();
+                $scope.addSearchItem(search);
+              } else {
+                if (search.length == 0) {
+                  $scope.clearSearchItem();
+                }
               }
-            }
-          };
-        }]
+            };
+          }
+        ]
       };
-    }]);
+    }
+  ]);
 })(window.angular);
diff --git a/app/common/directives/toggle-flag.js b/app/common/directives/toggle-flag.js
index 4a4e454..0869af3 100644
--- a/app/common/directives/toggle-flag.js
+++ b/app/common/directives/toggle-flag.js
@@ -1,31 +1,30 @@
 window.angular && (function(angular) {
   'use strict';
 
-  angular
-    .module('app.common.directives')
-    .directive('toggleFlag', function($document) {
-      return {
-        restrict: 'A',
-        link: function(scope, element, attrs) {
+  angular.module('app.common.directives')
+      .directive('toggleFlag', function($document) {
+        return {
+          restrict: 'A',
+          link: function(scope, element, attrs) {
 
-          function elementClick(e) {
-            e.stopPropagation();
+            function elementClick(e) {
+              e.stopPropagation();
+            }
+
+            function documentClick(e) {
+              scope[attrs.toggleFlag] = false;
+              scope.$apply();
+            }
+
+            element.on('click', elementClick);
+            $document.on('click', documentClick);
+
+            // remove event handlers when directive is destroyed
+            scope.$on('$destroy', function() {
+              element.off('click', elementClick);
+              $document.off('click', documentClick);
+            });
           }
-
-          function documentClick(e) {
-            scope[attrs.toggleFlag] = false;
-            scope.$apply();
-          }
-
-          element.on('click', elementClick);
-          $document.on('click', documentClick);
-
-          // remove event handlers when directive is destroyed
-          scope.$on('$destroy', function() {
-            element.off('click', elementClick);
-            $document.off('click', documentClick);
-          });
-        }
-      };
-    });
+        };
+      });
 })(window.angular);
