fix several ie8 issues

This commit is contained in:
nightwing 2014-09-06 02:23:37 +04:00
commit bb76c62c7b
5 changed files with 27 additions and 8 deletions

View file

@ -46,4 +46,10 @@ body {
position: absolute;
right: 0;
border-left: 1px solid;
}
}
/* .ace_text-input {
z-index: 10!important;
opacity: 1!important;
background: rgb(84, 0, 255)!important;
}*/

View file

@ -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) {

View file

@ -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;
}
};

View file

@ -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) {

View file

@ -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("-") + "-";