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