mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 22:57:58 +01:00
changed shift-insert patch
This commit is contained in:
@@ -488,7 +488,9 @@ function Events() //{{{
|
|||||||
{
|
{
|
||||||
var elt = window.document.commandDispatcher.focusedElement;
|
var elt = window.document.commandDispatcher.focusedElement;
|
||||||
|
|
||||||
if(elt.setSelectionRange) // to check if it's a selection?
|
if(elt.setSelectionRange && readFromClipboard())
|
||||||
|
// readFromClipboard would return 'undefined' if not checked
|
||||||
|
// dunno about .setSelectionRange
|
||||||
{
|
{
|
||||||
var rangeStart = elt.selectionStart; // caret position
|
var rangeStart = elt.selectionStart; // caret position
|
||||||
var rangeEnd = elt.selectionEnd;
|
var rangeEnd = elt.selectionEnd;
|
||||||
@@ -498,9 +500,10 @@ function Events() //{{{
|
|||||||
elt.value = tempStr1 + tempStr2 + tempStr3;
|
elt.value = tempStr1 + tempStr2 + tempStr3;
|
||||||
elt.selectionStart = rangeStart + tempStr2.length;
|
elt.selectionStart = rangeStart + tempStr2.length;
|
||||||
elt.selectionEnd = elt.selectionStart;
|
elt.selectionEnd = elt.selectionStart;
|
||||||
|
event.preventDefault();
|
||||||
|
// prevents additional firefox-clipboard pasting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user