@syncfusion/ej2-filemanager 25.1.39 → 25.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -897,8 +897,8 @@ function updatePath(node, data, instance) {
897
897
  */
898
898
  function getPath(element, text, hasId) {
899
899
  var matched = getParents(element, text, false, hasId);
900
- var path = hasId ? '' : '/';
901
- var len = matched.length - (hasId ? 1 : 2);
900
+ var path = '/';
901
+ var len = matched.length - (2);
902
902
  for (var i = len; i >= 0; i--) {
903
903
  path += matched[i] + '/';
904
904
  }
@@ -970,8 +970,8 @@ function getParents(element, text, isId, hasId) {
970
970
  */
971
971
  function generatePath(parent) {
972
972
  var key = parent.hasId ? 'id' : 'name';
973
- var newPath = parent.hasId ? '' : '/';
974
- var i = parent.hasId ? 0 : 1;
973
+ var newPath = '/';
974
+ var i = 1;
975
975
  for (i; i < parent.pathId.length; i++) {
976
976
  // eslint-disable-next-line
977
977
  var data = getValue(parent.pathId[i], parent.feParent);
@@ -6325,7 +6325,15 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
6325
6325
  var pasteEle = select('#' + this.getMenuId('Paste'), this.contextMenu.element);
6326
6326
  if (!args.cancel && !this.parent.enablePaste &&
6327
6327
  pasteEle && !pasteEle.classList.contains('e-disabled')) {
6328
- this.disabledItems.push('Paste');
6328
+ if (this.disabledItems.indexOf('Paste') === -1) {
6329
+ this.disabledItems.push('Paste');
6330
+ }
6331
+ }
6332
+ else {
6333
+ var pasteIndex = this.disabledItems.indexOf('Paste');
6334
+ if (pasteIndex !== -1) {
6335
+ this.disabledItems.splice(pasteIndex, 1);
6336
+ }
6329
6337
  }
6330
6338
  if (args.cancel) {
6331
6339
  this.menuTarget = this.currentElement = null;
@@ -6439,7 +6447,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
6439
6447
  this.disabledItems.push('SelectAll');
6440
6448
  }
6441
6449
  if (this.parent.selectedNodes.length === 0) {
6442
- this.disabledItems.push('Paste');
6450
+ if (this.disabledItems.indexOf('Paste') === -1) {
6451
+ this.disabledItems.push('Paste');
6452
+ }
6443
6453
  }
6444
6454
  this.contextMenu.dataBind();
6445
6455
  };