mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-14 01:38:51 +00:00
Monotone-Parent: b3b6f425c01979bb9afdf39c7034dfd2131f4dd3
Monotone-Revision: 24c2f8206b434e2894e6aa447358893a06cc7dc7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-29T02:49:43 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -283,10 +283,17 @@ function onTextKeyDown(event) {
|
||||
}
|
||||
else {
|
||||
if (!(event.shiftKey || event.metaKey || event.ctrlKey)) {
|
||||
if (this.selectionStart) { // FF
|
||||
var startText = this.value.substr(0, this.selectionStart);
|
||||
var endText = this.value.substr(this.selectionStart);
|
||||
this.value = startText + " " + endText;
|
||||
if (typeof(this.selectionStart)
|
||||
!= "undefined") { // For Mozilla and Safari
|
||||
var cursor = this.selectionStart;
|
||||
var startText = ((cursor > 0)
|
||||
? this.value.substr(0, cursor)
|
||||
: "");
|
||||
var endText = this.value.substr(cursor);
|
||||
var newText = startText + " " + endText;
|
||||
this.value = newText;
|
||||
cursor += 3;
|
||||
this.setSelectionRange(cursor, cursor);
|
||||
}
|
||||
else if (this.selectionRange) // IE
|
||||
this.selectionRange.text = " ";
|
||||
|
||||
Reference in New Issue
Block a user