Commit 41758f2b authored by ThorbenQuast's avatar ThorbenQuast
Browse files

editor: delete unnecessary requires and stabilize content initialization

parent bf3a9a14
......@@ -23,7 +23,7 @@ define(["jquery", "emitter", "./action", "require"], function($, Emitter, CodeEd
this.view.on("stateChange", function(key) {
if (key == "path") {
if (!self.node) return;
if (!self.ace) return;
var path = this.getState("path");
if (!path) return;
if (self.path == path) return;
......@@ -35,17 +35,13 @@ define(["jquery", "emitter", "./action", "require"], function($, Emitter, CodeEd
self.actions.save(function() {
self.actions.loadContent(path);
});
} else {
self.path = path;
} else
self.actions.loadContent(path);
}
} else if (key == "line") {
if (!self.path) return;
self.ace.gotoLine(this.getState("line"));
}
});
require(["ace/ace", "ace/ext/language_tools"]);
},
setup: function(node) {
......@@ -64,7 +60,6 @@ define(["jquery", "emitter", "./action", "require"], function($, Emitter, CodeEd
self.keyupMaxTimeout = self.keyupMaxTimeout || setTimeout(check, 1000);
});
ace.require("ace/ext/language_tools");
self.ace = ace.edit($(self.node).get(0));
self.ace.setOptions({
enableBasicAutocompletion: true,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment