diff --git a/angular-dropdowns.css b/angular-dropdowns.css index f0e830f..c4df1f6 100644 --- a/angular-dropdowns.css +++ b/angular-dropdowns.css @@ -7,6 +7,10 @@ margin: 0 auto; padding: 10px; + -webkit-user-select:none; + -moz-user-select:none; + user-select:none; + /* Styles */ background: #fff; border-radius: 7px; @@ -212,4 +216,4 @@ .wrap-dd-menu .dropdown.active { opacity: 1; pointer-events: auto; -} +} \ No newline at end of file diff --git a/angular-dropdowns.js b/angular-dropdowns.js index 604b5ac..35f6f81 100644 --- a/angular-dropdowns.js +++ b/angular-dropdowns.js @@ -29,7 +29,8 @@ dd.directive('dropdownSelect', ['DropdownService', '$window', }); }; - var $clickEvent = ('ontouchstart' in $window ? 'touchend' : 'click'); + // Does not register touchstart events outside of directive scope + var $clickEvent = ('click'||'touchstart' in $window); $element.bind($clickEvent, function (event) { event.stopPropagation(); DropdownService.toggleActive($element); @@ -103,7 +104,8 @@ dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window' controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { $scope.labelField = $attrs.dropdownItemLabel || 'text'; - var $clickEvent = ('ontouchstart' in $window ? 'touchend' : 'click'); + // Does not register touchstart events outside of directive scope. + var $clickEvent = ('click'||'touchstart'in $window); var $template = angular.element([ '