Commit 88548fe8 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

File2Extension: various drag'n'drop fixes

- enable drop onto the whole folder when in icon view
- prevent drop into the source container
parent d65164fa
......@@ -57,6 +57,8 @@
.file2.browser>.item-container.detail>.header>.size,.file2.browser>.item-container.detail>.items>.item>.size{-webkit-box-flex:0;-webkit-flex:0 0 70px;-ms-flex:0 0 70px;flex:0 0 70px;text-align:right}
.file2.browser>.item-container.detail>.header>.modified,.file2.browser>.item-container.detail>.items>.item>.modified{text-align:right;-webkit-box-flex:0;-webkit-flex:0 0 170px;-ms-flex:0 0 170px;flex:0 0 170px}
.file2.browser>.item-container.icons{overflow-y:scroll}
.file2.browser>.item-container.icons.dropok{background-color:#bf6!important}
.file2.browser>.item-container.icons.dropok>.items>.item{background:0 0}
.file2.browser>.item-container.icons>.items{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;padding:.5em}
.file2.browser>.item-container.icons>.items>.item{-webkit-box-flex:7.5em;-webkit-flex:7.5em 0 0;-ms-flex:7.5em 0 0;flex:7.5em 0 0;max-width:7.5em;margin:.36em;padding:.24em;border-radius:.6em}
.file2.browser>.item-container.icons>.items>.item:hover{background-color:#fafafa}
......
......@@ -266,6 +266,12 @@
}
&.icons {
overflow-y: scroll;
&.dropok {
background-color: @item-color-drag-dst !important;
> .items > .item {
background: none;
}
}
> .items {
display: flex;
flex-flow: row wrap;
......
<div class="item-container icons">
<div
:class="{
items: true,
dropok: dropok,
}"
v-drop:copy.dropok="dropFilter"
>
<div
:class="{
'item-container': true,
'icons': true,
'dropok': dropok,
}"
v-drop:copy.dropok="dropFilter"
>
<div class="items">
<item
v-for="(i, d) in sortedItems"
v-ref:items
......
......@@ -65,11 +65,12 @@ define([
};
}
ret["vispa/workspace:" + this.workspaceId] = String(this.workspaceId);
ret["vispa/pathbase:" + this.path.toLowerCase()] = this.path;
return ret;
},
dropFilter: function(ev) {
if (this.childDragged) return false;
return dropFilter(ev, this.workspaceId);
return dropFilter(ev, this.workspaceId, this.path);
},
},
computed: {
......
......@@ -67,7 +67,7 @@ define([
if (this.dragged) return false;
if (this.processing) return false;
if (this.data.type !== "d") return false;
return dropFilter(ev, this.workspaceId);
return dropFilter(ev, this.workspaceId, this.fullPath);
},
action: function(what, extra) {
this.$dispatch("action", what, $.extend({
......
define([
], function(
) {
var dropFilter = function(ev, workspaceId) {
var dropFilter = function(ev, workspaceId, tarPath) {
var types = ev.dataTransfer.types;
if (~types.indexOf("Files"))
return ["Files", "copy"];
else {
if (tarPath && ~types.indexOf("vispa/pathbase:" + tarPath.toLowerCase())) return;
if (!~types.indexOf("vispa/workspace:" + workspaceId)) return;
return ["vispa/file", "vispa/files", "move"];
}
......
......@@ -108,7 +108,7 @@ define([
this.$dispatch("nav", this.fullPath);
},
dropFilter: function(ev) {
return dropFilter(ev, this.workspaceId);
return dropFilter(ev, this.workspaceId, this.fullPath);
},
},
events: {
......
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