more fixes for Workspace

This commit is contained in:
Mihai Sucan 2011-02-20 14:58:59 +02:00
commit 54e8a799ac
5 changed files with 19 additions and 7 deletions

View file

@ -547,7 +547,6 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
if (require.packaged) {
var base = this.$guessBasePath();
dump("Worker " + base + " " + packagedJs + "\n");
var worker = this.$worker = new Worker(base + packagedJs);
}
else {

View file

@ -470,7 +470,6 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
if (require.packaged) {
var base = this.$guessBasePath();
dump("Worker " + base + " " + packagedJs + "\n");
var worker = this.$worker = new Worker(base + packagedJs);
}
else {

View file

@ -446,7 +446,6 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
if (require.packaged) {
var base = this.$guessBasePath();
dump("Worker " + base + " " + packagedJs + "\n");
var worker = this.$worker = new Worker(base + packagedJs);
}
else {

View file

@ -1,4 +1,5 @@
/* ***** BEGIN LICENSE BLOCK *****
/* vim:ts=4:sts=4:sw=4:
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -112,8 +113,12 @@ var Text = function(parentEl) {
// that's why we have to measure many characters
// Note: characterWidth can be a float!
measureNode.innerHTML = lang.stringRepeat("Xy", n);
var body = document.body || document.documentElement;
body.insertBefore(measureNode, body.firstChild);
var container = this.element.parentNode;
while (!dom.hasCssClass(container, "ace_editor"))
container = container.parentNode;
container.appendChild(measureNode);
}
var style = this.$measureNode.style;

View file

@ -1,4 +1,5 @@
/* ***** BEGIN LICENSE BLOCK *****
/* vim:ts=4:sts=4:sw=4:
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -20,6 +21,7 @@
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* Mihai Sucan <mihai DOT sucan AT gmail DOT com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -70,6 +72,14 @@ var UndoManager = function() {
this.$redoStack = [];
};
this.hasUndo = function() {
return this.$undoStack.length > 0;
};
this.hasRedo = function() {
return this.$redoStack.length > 0;
};
}).call(UndoManager.prototype);
exports.UndoManager = UndoManager;