diff --git a/demo/kitchen-sink/styles.css b/demo/kitchen-sink/styles.css index 7db52e45..3f46f701 100644 --- a/demo/kitchen-sink/styles.css +++ b/demo/kitchen-sink/styles.css @@ -46,4 +46,10 @@ body { position: absolute; right: 0; border-left: 1px solid; -} \ No newline at end of file +} + +/* .ace_text-input { + z-index: 10!important; + opacity: 1!important; + background: rgb(84, 0, 255)!important; +}*/ diff --git a/doc/site/js/main.js b/doc/site/js/main.js index b24383c0..3b9eaa26 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -161,7 +161,11 @@ function highlight() { var highlighter = ace.require("ace/ext/static_highlight") var dom = ace.require("ace/lib/dom") function qsa(sel) { - return Array.apply(null, document.querySelectorAll(sel)); + var els = document.querySelectorAll(sel); + var result = []; + for (var i = 0, l = els.length; i < l; i++) + result[i] = els[i]; + return result; } qsa("code[class]").forEach(function(el) { diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 1d5d63ae..71cda95c 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -969,8 +969,10 @@ var EditSession = function(text, mode) { try { this.$worker = this.$mode.createWorker(this); } catch (e) { - console.log("Could not load worker"); - console.log(e); + if (typeof console == "object") { + console.log("Could not load worker"); + console.log(e); + } this.$worker = null; } }; diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index e4e8f2a9..d2293024 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -51,6 +51,7 @@ var TextInput = function(parentNode, host) { text.spellcheck = false; text.style.opacity = "0"; + if (useragent.isOldIE) text.style.top = "-100px"; parentNode.insertBefore(text, parentNode.firstChild); var PLACEHOLDER = "\x01\x01"; @@ -436,6 +437,8 @@ var TextInput = function(parentNode, host) { }; this.moveToMouse = function(e, bringToFront) { + if (!bringToFront && useragent.isOldIE) + return; if (!tempStyle) tempStyle = text.style.cssText; text.style.cssText = (bringToFront ? "z-index:100000;" : "") @@ -460,13 +463,15 @@ var TextInput = function(parentNode, host) { host.renderer.$keepTextAreaAtCursor = null; // on windows context menu is opened after mouseup - if (useragent.isWin) + if (useragent.isWin && !useragent.isOldIE) event.capture(host.container, move, onContextMenuClose); }; this.onContextMenuClose = onContextMenuClose; + var closeTimeout; function onContextMenuClose() { - setTimeout(function () { + clearTimeout(closeTimeout) + closeTimeout = setTimeout(function () { if (tempStyle) { text.style.cssText = tempStyle; tempStyle = ''; @@ -475,7 +480,7 @@ var TextInput = function(parentNode, host) { host.renderer.$keepTextAreaAtCursor = true; host.renderer.$moveTextAreaToCursor(); } - }, 0); + }, useragent.isOldIE ? 200 : 0); } var onContextMenu = function(e) { diff --git a/lib/ace/lib/keys.js b/lib/ace/lib/keys.js index e708a5d4..e75a6e47 100644 --- a/lib/ace/lib/keys.js +++ b/lib/ace/lib/keys.js @@ -34,6 +34,8 @@ For more information about SproutCore, visit http://www.sproutcore.com define(function(require, exports, module) { "use strict"; +require("./fixoldbrowsers"); + var oop = require("./oop"); /* @@ -136,7 +138,7 @@ var Keys = (function() { (function() { var mods = ["cmd", "ctrl", "alt", "shift"]; - for (var i = Math.pow(2, mods.length); i--;) { + for (var i = Math.pow(2, mods.length); i--;) { ret.KEY_MODS[i] = mods.filter(function(x) { return i & ret.KEY_MODS[x]; }).join("-") + "-";