fix several ie8 issues
This commit is contained in:
parent
c0741f3511
commit
bb76c62c7b
5 changed files with 27 additions and 8 deletions
|
|
@ -46,4 +46,10 @@ body {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
border-left: 1px solid;
|
border-left: 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .ace_text-input {
|
||||||
|
z-index: 10!important;
|
||||||
|
opacity: 1!important;
|
||||||
|
background: rgb(84, 0, 255)!important;
|
||||||
|
}*/
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,11 @@ function highlight() {
|
||||||
var highlighter = ace.require("ace/ext/static_highlight")
|
var highlighter = ace.require("ace/ext/static_highlight")
|
||||||
var dom = ace.require("ace/lib/dom")
|
var dom = ace.require("ace/lib/dom")
|
||||||
function qsa(sel) {
|
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) {
|
qsa("code[class]").forEach(function(el) {
|
||||||
|
|
|
||||||
|
|
@ -969,8 +969,10 @@ var EditSession = function(text, mode) {
|
||||||
try {
|
try {
|
||||||
this.$worker = this.$mode.createWorker(this);
|
this.$worker = this.$mode.createWorker(this);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Could not load worker");
|
if (typeof console == "object") {
|
||||||
console.log(e);
|
console.log("Could not load worker");
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
this.$worker = null;
|
this.$worker = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ var TextInput = function(parentNode, host) {
|
||||||
text.spellcheck = false;
|
text.spellcheck = false;
|
||||||
|
|
||||||
text.style.opacity = "0";
|
text.style.opacity = "0";
|
||||||
|
if (useragent.isOldIE) text.style.top = "-100px";
|
||||||
parentNode.insertBefore(text, parentNode.firstChild);
|
parentNode.insertBefore(text, parentNode.firstChild);
|
||||||
|
|
||||||
var PLACEHOLDER = "\x01\x01";
|
var PLACEHOLDER = "\x01\x01";
|
||||||
|
|
@ -436,6 +437,8 @@ var TextInput = function(parentNode, host) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.moveToMouse = function(e, bringToFront) {
|
this.moveToMouse = function(e, bringToFront) {
|
||||||
|
if (!bringToFront && useragent.isOldIE)
|
||||||
|
return;
|
||||||
if (!tempStyle)
|
if (!tempStyle)
|
||||||
tempStyle = text.style.cssText;
|
tempStyle = text.style.cssText;
|
||||||
text.style.cssText = (bringToFront ? "z-index:100000;" : "")
|
text.style.cssText = (bringToFront ? "z-index:100000;" : "")
|
||||||
|
|
@ -460,13 +463,15 @@ var TextInput = function(parentNode, host) {
|
||||||
host.renderer.$keepTextAreaAtCursor = null;
|
host.renderer.$keepTextAreaAtCursor = null;
|
||||||
|
|
||||||
// on windows context menu is opened after mouseup
|
// on windows context menu is opened after mouseup
|
||||||
if (useragent.isWin)
|
if (useragent.isWin && !useragent.isOldIE)
|
||||||
event.capture(host.container, move, onContextMenuClose);
|
event.capture(host.container, move, onContextMenuClose);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onContextMenuClose = onContextMenuClose;
|
this.onContextMenuClose = onContextMenuClose;
|
||||||
|
var closeTimeout;
|
||||||
function onContextMenuClose() {
|
function onContextMenuClose() {
|
||||||
setTimeout(function () {
|
clearTimeout(closeTimeout)
|
||||||
|
closeTimeout = setTimeout(function () {
|
||||||
if (tempStyle) {
|
if (tempStyle) {
|
||||||
text.style.cssText = tempStyle;
|
text.style.cssText = tempStyle;
|
||||||
tempStyle = '';
|
tempStyle = '';
|
||||||
|
|
@ -475,7 +480,7 @@ var TextInput = function(parentNode, host) {
|
||||||
host.renderer.$keepTextAreaAtCursor = true;
|
host.renderer.$keepTextAreaAtCursor = true;
|
||||||
host.renderer.$moveTextAreaToCursor();
|
host.renderer.$moveTextAreaToCursor();
|
||||||
}
|
}
|
||||||
}, 0);
|
}, useragent.isOldIE ? 200 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var onContextMenu = function(e) {
|
var onContextMenu = function(e) {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ For more information about SproutCore, visit http://www.sproutcore.com
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
require("./fixoldbrowsers");
|
||||||
|
|
||||||
var oop = require("./oop");
|
var oop = require("./oop");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -136,7 +138,7 @@ var Keys = (function() {
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var mods = ["cmd", "ctrl", "alt", "shift"];
|
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) {
|
ret.KEY_MODS[i] = mods.filter(function(x) {
|
||||||
return i & ret.KEY_MODS[x];
|
return i & ret.KEY_MODS[x];
|
||||||
}).join("-") + "-";
|
}).join("-") + "-";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue