mirror of https://github.com/perkeep/perkeep.git
Prevent browser range selection
This commit is contained in:
parent
af7cce81fb
commit
ed67d8926a
|
@ -39,13 +39,17 @@ function divFromResult(searchRes, i) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
selSetter[i] = setSelected;
|
selSetter[i] = setSelected;
|
||||||
|
divperm.addEventListener("mousedown", function(e) {
|
||||||
|
if (e.shiftKey) {
|
||||||
|
e.preventDefault(); // prevent browser range selection
|
||||||
|
}
|
||||||
|
});
|
||||||
divperm.addEventListener("click", function(e) {
|
divperm.addEventListener("click", function(e) {
|
||||||
if (e.ctrlKey) {
|
if (e.ctrlKey) {
|
||||||
setSelected(!divperm.isSelected);
|
setSelected(!divperm.isSelected);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
e.stopPropagation(); // doesn't work? text is still selected :(
|
|
||||||
if (lastSelIndex < 0) {
|
if (lastSelIndex < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue