FIX: Opera Improvements (v12)
Fix issues with Opera 12 and its ability to utilize Discourse Composer window https://meta.discourse.org/t/support-for-opera/20218
This commit is contained in:
parent
4e5e7d718e
commit
9e3060a6f7
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue