},
/**
+ * Remove specified path and all children paths if already in clipboard
+ * @param {string} path full path
+ * @returns {number} current length of clipboard objects
+ */
+ removeRecursively: function Clipboard_removeRecursively(path) {
+ var childPattern = new RegExp(path),
+ index = this.data.length;
+ while (index--) {
+ if(childPattern.test(this.data[index])) {
+ this.data.splice(index, 1);
+ }
+ }
+ return this.data.length;
+ },
+
+ /**
* Checks if specified path is already in clipboard
* @param {string} path full path
* @returns {boolean}
self = this,
onDeleteNodeSuccess = function (node, isDir, fileobject) {
try {
- if (app.clipboard.remove(node.uri) === 0) {
- app.ui.refreshPasteActionBtn();
- }
+ app.clipboard.removeRecursively(node.uri);
+ app.ui.refreshPasteActionBtn();
+
this.refreshContent(fileobject.toURI());
} catch (e) {
console.error(e);