From 9313a7f16b0c2f94c1a49d5b78f717ce5a8a72f1 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 23 Oct 2014 14:12:37 +0200 Subject: [PATCH] Element picker tweaks - Indentation whitespace fixes. - Use built-in getBoundingClientRect() function instead of self-made. - Use built-in DOM API for manipulating the class attributes instead of altering the className property. - Add pointer-events: none to the svgRoot when using document.elementFromPoint(), but if the browser (older Safari for example) doesn't take the pointer-events into account, then fall back to display: none. - Initiate every part of the picker at the same time; when the message is received from the background. This way the selected element will have the red overlay immediately, instead of showing first the black overlay, then a few milliseconds later the red. --- src/js/vapi-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/vapi-client.js b/src/js/vapi-client.js index 34153cc..d350fcb 100644 --- a/src/js/vapi-client.js +++ b/src/js/vapi-client.js @@ -38,7 +38,7 @@ var messagingConnector = function(response) { // Safari bug // Deleting the response.requestId below (only in some cases, probably // when frames are present on the page) will remove it from all the - // following messages too, however with the following line it won't. + // future messages too, however with the following line it won't. vAPI.safari && console.log; delete vAPI.messaging.listeners[response.requestId];