@@ -54,8 +54,8 @@ dd.run(['$templateCache', function ($templateCache) {
5454
5555} ] ) ;
5656
57- dd . directive ( 'dropdownSelect' , [ 'DropdownService' , '$window' ,
58- function ( DropdownService , $window ) {
57+ dd . directive ( 'dropdownSelect' , [ 'DropdownService' ,
58+ function ( DropdownService ) {
5959 return {
6060 restrict : 'A' ,
6161 replace : true ,
@@ -79,9 +79,7 @@ dd.directive('dropdownSelect', ['DropdownService', '$window',
7979 } ) ;
8080 } ;
8181
82- // Does not register touchstart events outside of directive scope
83- var $clickEvent = ( 'click' || 'touchstart' in $window ) ;
84- $element . bind ( $clickEvent , function ( event ) {
82+ $element . bind ( 'click' , function ( event ) {
8583 event . stopPropagation ( ) ;
8684 DropdownService . toggleActive ( $element ) ;
8785 } ) ;
@@ -119,8 +117,8 @@ dd.directive('dropdownSelectItem', [
119117 }
120118] ) ;
121119
122- dd . directive ( 'dropdownMenu' , [ '$parse' , '$compile' , 'DropdownService' , '$window' , '$ templateCache',
123- function ( $parse , $compile , DropdownService , $window , $ templateCache) {
120+ dd . directive ( 'dropdownMenu' , [ '$parse' , '$compile' , 'DropdownService' , '$templateCache' ,
121+ function ( $parse , $compile , DropdownService , $templateCache ) {
124122 return {
125123 restrict : 'A' ,
126124 replace : false ,
@@ -133,8 +131,6 @@ dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window'
133131 controller : [ '$scope' , '$element' , '$attrs' , function ( $scope , $element , $attrs ) {
134132 $scope . labelField = $attrs . dropdownItemLabel || 'text' ;
135133
136- // Does not register touchstart events outside of directive scope.
137- var $clickEvent = ( 'click' || 'touchstart' in $window ) ;
138134 var $template = angular . element ( $templateCache . get ( 'ngDropdowns/templates/dropdownMenu.html' ) ) ;
139135 // Attach this controller to the element's data
140136 $template . data ( '$dropdownMenuController' , this ) ;
@@ -157,7 +153,7 @@ dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window'
157153 } ) ;
158154 } ;
159155
160- $element . bind ( $clickEvent , function ( event ) {
156+ $element . bind ( 'click' , function ( event ) {
161157 event . stopPropagation ( ) ;
162158 DropdownService . toggleActive ( tpl ) ;
163159 } ) ;
0 commit comments