|
|
@@ -45,7 +45,8 @@ const STATE = {
|
|
|
addingProject: false,
|
|
|
addingFolder: false,
|
|
|
deleting: false,
|
|
|
- importing: false
|
|
|
+ importing: false,
|
|
|
+ moving: false,
|
|
|
};
|
|
|
const projTreeObj = {
|
|
|
tree: null,
|
|
|
@@ -503,11 +504,16 @@ const projTreeObj = {
|
|
|
}
|
|
|
projTreeObj.moveTo(selected, null, parent, next, null, action);
|
|
|
$.bootstrapLoading.end();
|
|
|
+ STATE.moving = false;
|
|
|
projTreeObj.emitTreeChange();
|
|
|
});
|
|
|
},
|
|
|
//升级后选中节点的后兄弟节点不成为其子节点,因为有层级类型限制(相当于选中节点移动到父项后成为其后兄弟)
|
|
|
upLevel: function () {
|
|
|
+ if (STATE.moving) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ STATE.moving = true;
|
|
|
let selected = projTreeObj.tree.selected,
|
|
|
parent = selected.parent.parent,
|
|
|
next = selected.parent.nextSibling,
|
|
|
@@ -524,6 +530,10 @@ const projTreeObj = {
|
|
|
this.doAfterTreeOpr({selected, parent, next, projectMap});
|
|
|
},
|
|
|
downLevel: function () {
|
|
|
+ if (STATE.moving) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ STATE.moving = true;
|
|
|
let selected = projTreeObj.tree.selected,
|
|
|
parent = null,
|
|
|
next = null,
|
|
|
@@ -546,6 +556,10 @@ const projTreeObj = {
|
|
|
this.doAfterTreeOpr({selected, parent, next, projectMap}, 'downLevel');
|
|
|
},
|
|
|
upMove: function () {
|
|
|
+ if (STATE.moving) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ STATE.moving = true;
|
|
|
let selected = projTreeObj.tree.selected,
|
|
|
parent = selected.parent,
|
|
|
next = selected.preSibling(),
|
|
|
@@ -563,6 +577,10 @@ const projTreeObj = {
|
|
|
this.doAfterTreeOpr({selected, parent, next, projectMap});
|
|
|
},
|
|
|
downMove: function () {
|
|
|
+ if (STATE.moving) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ STATE.moving = true;
|
|
|
let selected = projTreeObj.tree.selected,
|
|
|
parent = selected.parent,
|
|
|
next = selected.nextSibling.nextSibling,
|