 
     closeDropdown = (evt) ->
       toggleElement = openScope.getToggleElement()
-
       if evt and toggleElement?[0].contains(evt.target) or
       evt?.target.nodeName.toLowerCase() is 'input' # Don't close if the drop down has an input interaction
         return

      return

    scope.$watch 'isOpen', (isOpen, wasOpen) ->
      if isOpen
        self.$element.attr(dropDownOpen, '')
        scope.focusToggleElement()
        dropdownService.open scope
      else
        self.$element.removeAttr(dropDownOpen)
        dropdownService.close scope
      setIsOpen $scope, isOpen
      if angular.isDefined(isOpen) and isOpen isnt wasOpen
        toggleInvoker $scope,

      dropdownScope.forceClose

        if dropdownScope.forceClose
          openScope.isOpen = false if openScope

        openScope = null
        $document.unbind 'click', closeDropdown
