Commit 2268c2e0 authored by Fabian-Andree Heidemann's avatar Fabian-Andree Heidemann
Browse files

[codeeditor] fix state and prepare shortcuts

parent 8c0f14db
......@@ -30,7 +30,7 @@ define(["jquery", "emitter", "vispa/extension"], function($, Emitter, Extension)
this.cookieName = null;
this.commandCookie = null;
this.view.on("stateChange", function(key) {
this.view.on("changedState", function(key) {
if (!self.commandline)
return;
switch (key) {
......
......@@ -36,7 +36,7 @@ define([
this.actions = new CodeEditorActions(this, view);
this.view.on("stateChange", function(key) {
this.view.on("changedState", function(key) {
if (key == "path") {
if (!self.ace) return;
var path = self.view.state.get("path");
......@@ -91,7 +91,7 @@ define([
self.applyShortcuts();
// trigger loading of state again since we can handle it now
self.view.emit("stateChange", "path");
self.view.emit("changedState", "path");
self.ace.focus();
self.ace.resize();
self.view.setLoading(false);
......@@ -239,8 +239,8 @@ define([
}.bind(this));
// overwrite with custom commands
var shortcuts = $.extend(true, {}, this.view._shortcuts);
var shortcutData = $.extend(true, {}, this.view._extension._defaultShortcuts.CodeEditor);
var shortcuts = $.extend(true, {}, this.view.shortcuts.children());
var shortcutData = $.extend(true, {}, Prefs.shortcuts);
//entries with incorrect syntax due to key even indication
var notAllowed = [];
......
......@@ -27,7 +27,7 @@ define(["jquery", "emitter", "text!../html/preview.html"], function($, Emitter,
this.thumbnailSize = null;
this.view.on("stateChange", function(key) {
this.view.on("changedState", function(key) {
switch (key) {
case "path":
var path = self.view.state.get("path");
......@@ -105,7 +105,7 @@ define(["jquery", "emitter", "text!../html/preview.html"], function($, Emitter,
self.loaderInterval = setInterval(function() {
self.refresh();
}, 1000);
self.view.emit("stateChange", "previewPath");
self.view.emit("changedState", "previewPath");
return this;
},
......
......@@ -83,7 +83,7 @@ define(["jquery", "emitter"], function($, Emitter) {
}
});
this.view.on("stateChange", function(key) {
this.view.on("changedState", function(key) {
if (key == "showOutput") {
self.setInputOutputRatio();
}
......
......@@ -112,7 +112,7 @@ define([
this.commandLine.setup(node);
this.applyPreferences();
this._applyShortcuts();
// this._applyShortcuts();
//initially set the icon
this.icon = "fa-align-left";
this.setLoading(false);
......
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