Skip to content

Commit 4aebdbb

Browse files
committed
Add quit button to element zapper mode
Related issue: uBlockOrigin/uBlock-issues#1968 Given the availability of this new quit button, the element zapper will now default to stick around after zapping an element.
1 parent fba6624 commit 4aebdbb

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/css/epicker-ui.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ html#ublock0-epicker,
1616
border: 1px solid var(--border-2);
1717
box-sizing: border-box;
1818
cursor: default;
19-
display: none;
19+
display: flex;
2020
flex-direction: column;
2121
max-width: min(32rem, 100vw - 4px);
2222
min-width: min(24rem, 100vw - 4px);
@@ -25,8 +25,18 @@ html#ublock0-epicker,
2525
width: min(32rem, 100vw - 4px);
2626
z-index: 100;
2727
}
28-
#ublock0-epicker:not(.zap) aside {
29-
display: flex;
28+
#ublock0-epicker.zap aside {
29+
min-width: unset !important;
30+
width: unset !important;
31+
}
32+
#ublock0-epicker.zap aside > section,
33+
#ublock0-epicker.zap aside > ul,
34+
#ublock0-epicker.zap aside > #windowbar > div:not(#quit) {
35+
display: none;
36+
}
37+
#ublock0-epicker.zap aside > #windowbar > #quit {
38+
height: 2.5em;
39+
width: 2.5em;
3040
}
3141
#ublock0-epicker:not(.paused) aside,
3242
#ublock0-epicker.minimized aside {

src/js/epicker-ui.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ const onSvgClicked = function(ev) {
331331
mx: ev.clientX,
332332
my: ev.clientY,
333333
options: {
334-
stay: ev.shiftKey || ev.type === 'touch',
334+
stay: true,
335335
highlight: ev.target !== svgIslands,
336336
},
337337
});
@@ -822,6 +822,8 @@ const startPicker = function() {
822822

823823
unpausePicker();
824824

825+
$id('quit').addEventListener('click', onQuitClicked);
826+
825827
if ( pickerRoot.classList.contains('zap') ) { return; }
826828

827829
cmEditor.on('changes', onCandidateChanged);
@@ -837,7 +839,6 @@ const startPicker = function() {
837839
dom.cl.toggle(pickerRoot, 'minimized');
838840
}
839841
});
840-
$id('quit').addEventListener('click', onQuitClicked);
841842
$id('move').addEventListener('mousedown', onStartMoving);
842843
$id('move').addEventListener('touchstart', onStartMoving);
843844
$id('candidateFilters').addEventListener('click', onCandidateClicked);

0 commit comments

Comments
 (0)