From 49632a61ebd437537a1662815095650811ca3a5d Mon Sep 17 00:00:00 2001 From: dafyk Date: Sun, 25 Jan 2015 12:23:57 +0100 Subject: [PATCH] Fix position calculation When object height is lower than 33px value with double minus is incorrectly returned --- chardinjs.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chardinjs.coffee b/chardinjs.coffee index 42367b9..c09b59e 100755 --- a/chardinjs.coffee +++ b/chardinjs.coffee @@ -92,8 +92,8 @@ do ($ = window.jQuery, window) -> tooltip_layer.style.top = "#{(target_height/2)-(tooltip_layer_position.height/2)}px" switch @._get_position(element) - when "left" then tooltip_layer.style.left = "-" + (tooltip_layer_position.width - 34) + "px" - when "right" then tooltip_layer.style.right = "-" + (tooltip_layer_position.width - 34) + "px" + when "left" then tooltip_layer.style.left = (34 - tooltip_layer_position.width) + "px" + when "right" then tooltip_layer.style.right = (34 - tooltip_layer_position.width) + "px" when "bottom" then tooltip_layer.style.bottom = "-" + (tooltip_layer_position.height) + "px" when "top" then tooltip_layer.style.top = "-" + (tooltip_layer_position.height) + "px"