mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Use workaround from Ace's commits.
This commit is contained in:
parent
c2df5dc01c
commit
2ac6b70a1c
1 changed files with 7 additions and 10 deletions
|
@ -1350,11 +1350,6 @@ if (typeof navigator != "object")
|
||||||
|
|
||||||
var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
|
var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
|
||||||
var ua = navigator.userAgent;
|
var ua = navigator.userAgent;
|
||||||
|
|
||||||
var safariRegex = /version\/([\w\.]+).+?(mobile\s?safari|safari)/i;
|
|
||||||
var safariResult = ua.match(safariRegex);
|
|
||||||
var safariVersion = safariResult ? parseFloat(safariResult[1]) : 0;
|
|
||||||
|
|
||||||
exports.isWin = (os == "win");
|
exports.isWin = (os == "win");
|
||||||
exports.isMac = (os == "mac");
|
exports.isMac = (os == "mac");
|
||||||
exports.isLinux = (os == "linux");
|
exports.isLinux = (os == "linux");
|
||||||
|
@ -1371,8 +1366,6 @@ exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
|
||||||
|
|
||||||
exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
|
exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
|
||||||
|
|
||||||
exports.isSafari = safariVersion || undefined;
|
|
||||||
|
|
||||||
exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
|
exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
|
||||||
|
|
||||||
exports.isIPad = ua.indexOf("iPad") >= 0;
|
exports.isIPad = ua.indexOf("iPad") >= 0;
|
||||||
|
@ -2290,9 +2283,13 @@ var TextInput = function(parentNode, host) {
|
||||||
if (e.type == "compositionend" && c.range) {
|
if (e.type == "compositionend" && c.range) {
|
||||||
host.selection.setRange(c.range);
|
host.selection.setRange(c.range);
|
||||||
}
|
}
|
||||||
// WORKAROUND: Accent keys and Korean keys don't work in Chrome >53.
|
var needsOnInput =
|
||||||
// https://github.com/ajaxorg/ace/issues/3045
|
(!!useragent.isChrome && useragent.isChrome >= 53) ||
|
||||||
if (useragent.isChrome >= 53 || useragent.isSafari >= 10.1) onInput();
|
(!!useragent.isWebKit && useragent.isWebKit >= 603);
|
||||||
|
|
||||||
|
if (needsOnInput) {
|
||||||
|
onInput();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue