Browse Source

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.
pull/2/head
Deathamns 10 years ago
committed by gorhill
parent
commit
9313a7f16b
  1. 2
      src/js/vapi-client.js

2
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];

Loading…
Cancel
Save