convenience: shift-click to stay in element-zapper mode

This commit is contained in:
gorhill 2017-05-28 13:45:11 -04:00
parent c1589cafaa
commit 189c9d55dd
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 3 deletions

View File

@ -1214,6 +1214,8 @@ var zap = function() {
document.documentElement.style.setProperty('overflow', 'auto', 'important'); document.documentElement.style.setProperty('overflow', 'auto', 'important');
} }
elem.parentNode.removeChild(elem); elem.parentNode.removeChild(elem);
elem = elementFromPoint();
highlightElements(elem ? [elem] : []);
}; };
/******************************************************************************/ /******************************************************************************/
@ -1281,7 +1283,9 @@ var onSvgClicked = function(ev) {
} }
if ( pickerBody.classList.contains('zap') ) { if ( pickerBody.classList.contains('zap') ) {
zap(); zap();
stopPicker(); if ( !ev.shiftKey ) {
stopPicker();
}
return; return;
} }
showDialog(); showDialog();
@ -1304,8 +1308,6 @@ var onKeyPressed = function(ev) {
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();
zap(); zap();
elem = elementFromPoint();
highlightElements(elem ? [elem] : []);
return; return;
} }
// Esc // Esc