From f19d5e942fbbd8e6d761d8f2e9bcc6778d75b426 Mon Sep 17 00:00:00 2001 From: MsSterh Date: Fri, 23 Aug 2013 17:44:37 +0300 Subject: [PATCH 1/2] Fixed touch device detected for new version of Chrome (29.0.1547.57). --- jquery.clickout.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.clickout.js b/jquery.clickout.js index 335fc1f..4500796 100644 --- a/jquery.clickout.js +++ b/jquery.clickout.js @@ -34,7 +34,8 @@ * Touchstart is. * @static */ - click = window.Touch ? 'touchstart' : 'click'; + is_touch_device = 'ontouchstart' in document.documentElement, + click = is_touch_device ? 'touchstart' : 'mousedown'; /** @@ -115,4 +116,4 @@ return $; -}); \ No newline at end of file +}); From cde0a9bce9720732b9b1624c1f8888660a952911 Mon Sep 17 00:00:00 2001 From: MsSterh Date: Tue, 22 Oct 2013 10:55:33 +0300 Subject: [PATCH 2/2] Fixed clicking inside element. --- jquery.clickout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.clickout.js b/jquery.clickout.js index 4500796..c01deef 100644 --- a/jquery.clickout.js +++ b/jquery.clickout.js @@ -89,7 +89,7 @@ // A closure is used create a static id return function(e){ // If the click is not inside the element, call the callback - if (!e.originalEvent.clickin || e.originalEvent.clickin !== id) { + if (!(e.target.clickin && e.target.clickin == id) && $(handleObj.selector ? handleObj.selector : target).is(":visible")) { handleObj.handler.apply(this, arguments); } };