Commit 3d7e3f7b authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Merge.

parents a7225e90 f92cb9c0
......@@ -405,6 +405,9 @@ define(["jquery", "jclass"], function($, JClass) {
if (path === undefined) {
path = this.FileBase.instance.getState("path");
}
// already existent?
if ($(".file-input", self.FileBase.view.node).length !== 0) return;
// create new input
var input = $("<input />");
input.attr({
"type": "file",
......@@ -416,18 +419,19 @@ define(["jquery", "jclass"], function($, JClass) {
"uploadUrl": vispa.url.dynamic("ajax/fs/upload?path=" + path +
"&_workspaceId=" + String(self.FileBase.instance.getWorkspaceId())),
});
input = $(".file-input", self.FileBase.view.node);
// add close button
var closeButton = $("<div class='btn btn-danger'><i class='glyphicon glyphicon-remove'></i>close</div>")
.appendTo(input.parent().parent());
closeButton.on(vispa.hasTouch ? "tab" : "click", function(event) {
$(".file-input", self.FileBase.view.node).remove();
.appendTo(".input-group-btn", input);
closeButton.on(vispa.hasTouch ? "tab" : "click", function() {
input.remove();
});
// events
// disable close button while upload, enable afterwards
$(".file-input", self.FileBase.view.node).on("filebatchpreupload", function() {
input.on("filebatchpreupload", function() {
closeButton.toggleClass("disabled", true);
});
$(".file-input", self.FileBase.view.node).on("filereset", function() {
input.on("filereset", function() {
closeButton.toggleClass("disabled", false);
});
},
......
......@@ -190,6 +190,7 @@ define([
this.helper.sortItems(content, sort, reverse);
this.workflow.currentView.setContent(content);
this.pathBar.render();
$(".file-input", this.view.node).remove();
this.menuitems.hideMenu();
var label = content.path || this.instance.getState("path");
// remove a slash in the end via a regexp
......
......@@ -276,13 +276,14 @@ define(["jquery", "jclass"], function($, JClass) {
// if transfered data empty: no drag but upload
var path = "";
if (fileToBeMoved === "") {
// TODO: drag and drop upload
// set path of file/folder to move
if (data.type == "d") {
path = self.FileBase.instance.getState("path") + "/" + data.name;
} else {
path = self.FileBase.instance.getState("path");
}
self.FileBase.actions.upload(path);
// if (data.type == "d") {
// path = self.FileBase.instance.getState("path") + "/" + data.name;
// } else {
// path = self.FileBase.instance.getState("path");
// }
// self.FileBase.actions.upload(path);
}
// if transfered data not empty: move file
else {
......
......@@ -39,7 +39,7 @@ define(["./base/views/symbol", "./base/views/table", "./selector/selectortablevi
buttonClass: "btn-default",
callback: function() {
//noinspection JSLint
this.fb.changeView(Symbolview);
this.fb.changeView(SymbolView);
}
}, {
id: "Table",
......@@ -48,7 +48,7 @@ define(["./base/views/symbol", "./base/views/table", "./selector/selectortablevi
buttonClass: "btn-default",
callback: function() {
//noinspection JSLint
this.fb.changeView(Tableview);
this.fb.changeView(TableView);
}
}]
}, {
......
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