Commit f0ab2cb8 authored by Erik Geiser's avatar Erik Geiser
Browse files

[CodeEditor] Fixed FileSelector prompts, especially open new file

parent 65695ece
......@@ -220,7 +220,8 @@ define(["jquery", "emitter"], function($, Emitter) {
//file selection with selector
var args = {
"path": path,
path: path,
savemode: true,
callback: function(path) {
if (path === null)
return;
......
......@@ -33,7 +33,7 @@ define([
return (~fileExtensions.indexOf(ext)) ? 1 : 1001;
},
}, function(path) {
return ["codeeditor", "CodeEditorView", {path: path}];
return ["codeeditor", "CodeEditor", {path: path}];
});
return CodeEditorExtension;
......
......@@ -282,7 +282,8 @@ define(["jquery", "emitter"], function($, Emitter) {
path = parts.join("/");
var args = {
"path": path,
path: path,
savemode: true,
callback: function(path) {
var fileExtension = path.split(".").pop().toLowerCase();
if (fileExtension != "txt")
......
......@@ -282,7 +282,7 @@ define(function() {
return (~fileExtensions.indexOf(ext)) ? 1 : 1001;
},
callback: function () {
(this.$root && this.$root.view || vispa).spawnInstance("codeeditor", "CodeEditorView",
(this.$root && this.$root.view || vispa).spawnInstance("codeeditor", "CodeEditor",
{path: this.value});
}
}];
......
......@@ -202,7 +202,7 @@ define([
var self = this;
//get the current workpath
var path = null;
var path;
if (this.editor.path) {
path = this.editor.path;
var parts = path.split("/");
......@@ -217,7 +217,7 @@ define([
if (path === null)
return;
var fileExtension = path.split(".").pop().toLowerCase();
if (self._extension.fileExtensions.indexOf(fileExtension) == -1) {
if (Prefs.extensions.indexOf(fileExtension) == -1) {
var msg = "<html>File extension '" + fileExtension +
"' is not supported! <br /> Open anyway?</html>";
self.confirm(msg, function(confirmed) {
......@@ -244,7 +244,7 @@ define([
},{
iconClass: "fa-file-text",
label: "CodeEditor",
name: "CodeEditorView",
name: "CodeEditor",
menuPosition: 30,
preferences: {
items: Prefs.preferences,
......
Markdown is supported
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