@syncfusion/ej2-filemanager 26.1.35 → 26.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.
@@ -2908,17 +2908,17 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
2908
2908
  if (isFileSystemData(parent)) {
2909
2909
  const filePath = event === 'node-expand' || event === 'finalize-end' ? getValue('path', data) : parent.path;
2910
2910
  const pathArray = filePath.replace(/^\/|\/$/g, '').split('/');
2911
- const idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length != 0)
2911
+ const idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length !== 0)
2912
2912
  || (event === 'paste-end' && (parent.targetModule === 'largeiconsview' || parent.targetModule === 'detailsview'))
2913
2913
  ? getValue('data', data)[0].id : pathArray[pathArray.length - 1];
2914
2914
  const action = getValue('action', data);
2915
2915
  const isFileOperation = (action === 'move' || action === 'rename' || action === 'copy' || action === 'delete' || action === 'search') && event !== 'rename-end';
2916
2916
  if (action === 'read' || action === 'create' || event === 'rename-end') {
2917
2917
  parent.responseData = {
2918
- cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue),
2918
+ cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue),
2919
2919
  details: null,
2920
2920
  error: null,
2921
- files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue)
2921
+ files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue)
2922
2922
  };
2923
2923
  if (isNullOrUndefined(parent.responseData.cwd)) {
2924
2924
  const message = 'Cannot load empty data within the File Manager.';
@@ -6659,6 +6659,16 @@ class ContextMenu {
6659
6659
  if (uid === this.parent.pathId[0]) {
6660
6660
  this.disabledItems.push('Delete', 'Rename', 'Cut', 'Copy');
6661
6661
  }
6662
+ else {
6663
+ const itemsToRemove = ['Delete', 'Rename', 'Cut', 'Copy'];
6664
+ for (let i = 0; i < this.disabledItems.length; i++) {
6665
+ const item = this.disabledItems[i];
6666
+ if (itemsToRemove.indexOf(item) !== -1) {
6667
+ this.disabledItems.splice(i, 1);
6668
+ i--;
6669
+ }
6670
+ }
6671
+ }
6662
6672
  /* istanbul ignore next */
6663
6673
  }
6664
6674
  else if (view === 'TreeView' || view === 'GridView' || view === 'LargeIcon') {
@@ -6770,6 +6780,12 @@ class ContextMenu {
6770
6780
  if (this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
6771
6781
  this.disabledItems.push('Open');
6772
6782
  }
6783
+ else {
6784
+ const indexToRemove = this.disabledItems.indexOf('Open');
6785
+ if (indexToRemove !== -1) {
6786
+ this.disabledItems.splice(indexToRemove, 1);
6787
+ }
6788
+ }
6773
6789
  if (this.parent.selectedItems.length === 0) {
6774
6790
  const renameIndex = this.disabledItems.indexOf('Rename');
6775
6791
  if (renameIndex !== -1) {
@@ -9290,7 +9306,8 @@ class Virtualization {
9290
9306
  this.scrollPosition = scroll;
9291
9307
  // Update the list of items and the items property of the largeIconInstance
9292
9308
  this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
9293
- this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ? this.largeIconInstance.itemList.length : this.itemCount;
9309
+ this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ?
9310
+ this.largeIconInstance.itemList.length : this.itemCount;
9294
9311
  this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
9295
9312
  this.itemCount, this.renderedCount);
9296
9313
  }