From 17c0c06e9785c0572cca29c791e43cc015b9fd38 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sat, 5 Jul 2014 15:16:03 +0700 Subject: [PATCH] Fix positioning when scrolled --- background.js | 4 ++-- resources/playground.html | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index b389e25..b5df5e2 100644 --- a/background.js +++ b/background.js @@ -164,14 +164,14 @@ log('Event: '+ e_left +','+ e_top); // Default positioning - var t_top = s_top + e_top - t_height - 20, + var t_top = e_top - t_height - 20, t_left = s_left + e_left - t_width / 2; log('Initial position: '+ t_left +','+ t_top); if (t_top < 10) { // Vertical positioning correction - t_top = 10; + t_top = s_top + 10; if (e_left > w_width / 2) { t_left = s_left + e_left - t_width - 20; diff --git a/resources/playground.html b/resources/playground.html index 19cdc29..acc70d5 100644 --- a/resources/playground.html +++ b/resources/playground.html @@ -4,6 +4,7 @@ Playground