Merge pull request #2810 from cpradio/opera-composer-keyboard-shortucts

FIX: Opera Composer Keyboard Shortcuts
This commit is contained in:
Sam 2014-09-22 11:50:14 +10:00
commit aa39a3b4b0
1 changed files with 2 additions and 7 deletions

View File

@ -43,8 +43,7 @@
// Used to work around some browser bugs where we can't use feature testing. // Used to work around some browser bugs where we can't use feature testing.
uaSniffed = { uaSniffed = {
isIE: /msie/.test(nav.userAgent.toLowerCase()), isIE: /msie/.test(nav.userAgent.toLowerCase()),
isIE_5or6: /msie 6/.test(nav.userAgent.toLowerCase()) || /msie 5/.test(nav.userAgent.toLowerCase()), isIE_5or6: /msie 6/.test(nav.userAgent.toLowerCase()) || /msie 5/.test(nav.userAgent.toLowerCase())
isOpera: /opera/.test(nav.userAgent.toLowerCase())
}; };
var defaultsStrings = { var defaultsStrings = {
@ -743,7 +742,7 @@
return; return;
} }
if (inputArea.selectionStart !== undefined && !uaSniffed.isOpera) { if (inputArea.selectionStart !== undefined) {
inputArea.focus(); inputArea.focus();
inputArea.selectionStart = stateObj.start; inputArea.selectionStart = stateObj.start;
@ -1325,10 +1324,6 @@
makeSpritedButtonRow(); makeSpritedButtonRow();
var keyEvent = "keydown"; var keyEvent = "keydown";
if (uaSniffed.isOpera) {
keyEvent = "keypress";
}
util.addEvent(inputBox, keyEvent, function (key) { util.addEvent(inputBox, keyEvent, function (key) {
// Check to see if we have a button key and, if so execute the callback. // Check to see if we have a button key and, if so execute the callback.