@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.
@@ -748,8 +748,8 @@ function updatePath(node, data, instance) {
748
748
  */
749
749
  function getPath(element, text, hasId) {
750
750
  const matched = getParents(element, text, false, hasId);
751
- let path = hasId ? '' : '/';
752
- const len = matched.length - (hasId ? 1 : 2);
751
+ let path = '/';
752
+ const len = matched.length - (2);
753
753
  for (let i = len; i >= 0; i--) {
754
754
  path += matched[i] + '/';
755
755
  }
@@ -821,8 +821,8 @@ function getParents(element, text, isId, hasId) {
821
821
  */
822
822
  function generatePath(parent) {
823
823
  const key = parent.hasId ? 'id' : 'name';
824
- let newPath = parent.hasId ? '' : '/';
825
- let i = parent.hasId ? 0 : 1;
824
+ let newPath = '/';
825
+ let i = 1;
826
826
  for (i; i < parent.pathId.length; i++) {
827
827
  // eslint-disable-next-line
828
828
  const data = getValue(parent.pathId[i], parent.feParent);
@@ -6163,7 +6163,15 @@ class ContextMenu$2 {
6163
6163
  const pasteEle = select('#' + this.getMenuId('Paste'), this.contextMenu.element);
6164
6164
  if (!args.cancel && !this.parent.enablePaste &&
6165
6165
  pasteEle && !pasteEle.classList.contains('e-disabled')) {
6166
- this.disabledItems.push('Paste');
6166
+ if (this.disabledItems.indexOf('Paste') === -1) {
6167
+ this.disabledItems.push('Paste');
6168
+ }
6169
+ }
6170
+ else {
6171
+ const pasteIndex = this.disabledItems.indexOf('Paste');
6172
+ if (pasteIndex !== -1) {
6173
+ this.disabledItems.splice(pasteIndex, 1);
6174
+ }
6167
6175
  }
6168
6176
  if (args.cancel) {
6169
6177
  this.menuTarget = this.currentElement = null;
@@ -6277,7 +6285,9 @@ class ContextMenu$2 {
6277
6285
  this.disabledItems.push('SelectAll');
6278
6286
  }
6279
6287
  if (this.parent.selectedNodes.length === 0) {
6280
- this.disabledItems.push('Paste');
6288
+ if (this.disabledItems.indexOf('Paste') === -1) {
6289
+ this.disabledItems.push('Paste');
6290
+ }
6281
6291
  }
6282
6292
  this.contextMenu.dataBind();
6283
6293
  }