From 189c9d55dd2591b0fd53186ea2c8fb6ace71db54 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 28 May 2017 13:45:11 -0400 Subject: [PATCH] convenience: shift-click to stay in element-zapper mode --- src/js/scriptlets/element-picker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/scriptlets/element-picker.js b/src/js/scriptlets/element-picker.js index 23fb0abb0..61c1e0cd2 100644 --- a/src/js/scriptlets/element-picker.js +++ b/src/js/scriptlets/element-picker.js @@ -1214,6 +1214,8 @@ var zap = function() { document.documentElement.style.setProperty('overflow', 'auto', 'important'); } elem.parentNode.removeChild(elem); + elem = elementFromPoint(); + highlightElements(elem ? [elem] : []); }; /******************************************************************************/ @@ -1281,7 +1283,9 @@ var onSvgClicked = function(ev) { } if ( pickerBody.classList.contains('zap') ) { zap(); - stopPicker(); + if ( !ev.shiftKey ) { + stopPicker(); + } return; } showDialog(); @@ -1304,8 +1308,6 @@ var onKeyPressed = function(ev) { ev.stopPropagation(); ev.preventDefault(); zap(); - elem = elementFromPoint(); - highlightElements(elem ? [elem] : []); return; } // Esc