From e318f5056c3752648b07277fb66e253750e13e64 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 28 Sep 2014 14:58:26 -0400 Subject: [PATCH] refining --- js/element-picker.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/element-picker.js b/js/element-picker.js index 334be70f3..aa02ec8df 100644 --- a/js/element-picker.js +++ b/js/element-picker.js @@ -954,6 +954,8 @@ var startPicker = function() { urlNormalizer = document.createElement('a'); window.addEventListener('scroll', onScrolled); document.addEventListener('keydown', onKeyPressed); + + highlightElements([], true); }; /******************************************************************************/ @@ -985,9 +987,11 @@ messaging.ask({ what: 'elementPickerArguments' }, function(details) { // Try using mouse position if ( details.clientX !== -1 ) { elem = elementFromPoint(details.clientX, details.clientY); - filtersFromElement(elem); - showDialog(); - return; + if ( elem !== null ) { + filtersFromElement(elem); + showDialog(); + return; + } } // No mouse position available, use suggested target @@ -1027,6 +1031,8 @@ messaging.ask({ what: 'elementPickerArguments' }, function(details) { } }); +// https://www.youtube.com/watch?v=sociXdKnyr8 + /******************************************************************************/ })();