fix several ie8 issues
This commit is contained in:
parent
c0741f3511
commit
bb76c62c7b
5 changed files with 27 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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("-") + "-";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue