Skip to content

Commit b61c286

Browse files
committed
Bug #77 not working on chrome > 50 and android > 6
1 parent 008e584 commit b61c286

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/scripts/directive.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function() {
22
'use strict';
3-
3+
console.log();
44
var colorPicker = function ($document, $timeout) {
55
return {
66
restrict: 'E',
@@ -23,6 +23,8 @@
2323
link: function ($scope, element, attrs, control) {
2424
$scope.onChangeValue = null;
2525
$scope.updateModel = true;
26+
$scope.chrome = Boolean(window.chrome);
27+
$scope.android_version = parseFloat(window.navigator.userAgent.match(/Android\s([0-9\.]*)/i)[1]);
2628

2729
$scope.init = function () {
2830
// if no color provided
@@ -657,7 +659,7 @@
657659
docElem = doc.documentElement;
658660

659661
// hack for small chrome screens not position the clicks properly when the page is scrolled
660-
if (window.chrome && screen.width <= 768) {
662+
if ($scope.chrome && $scope.android_version < 6 && screen.width <= 768) {
661663
return {
662664
top: rect.top - docElem.clientTop,
663665
left: rect.left - docElem.clientLeft

0 commit comments

Comments
 (0)