@syncfusion/ej2-filemanager 26.2.4 → 26.2.7

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.
@@ -2914,11 +2914,17 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
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
+ const rootId = parent.fileSystemData
2918
+ .filter((item) => isNullOrUndefined(item.parentId))
2919
+ .length > 0
2920
+ ? parent.fileSystemData
2921
+ .filter((item) => isNullOrUndefined(item.parentId))[0].id
2922
+ : 0;
2917
2923
  parent.responseData = {
2918
- cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue),
2924
+ cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? rootId : idValue),
2919
2925
  details: null,
2920
2926
  error: null,
2921
- files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue)
2927
+ files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? rootId : idValue)
2922
2928
  };
2923
2929
  if (isNullOrUndefined(parent.responseData.cwd)) {
2924
2930
  const message = 'Cannot load empty data within the File Manager.';
@@ -6642,6 +6648,9 @@ class ContextMenu {
6642
6648
  }
6643
6649
  else if (closest(target, '#' + this.parent.element.id + TREE_ID)) {
6644
6650
  uid = closest(target, 'li').getAttribute('data-uid');
6651
+ if (!isNullOrUndefined(uid)) {
6652
+ this.parent.navigationpaneModule.treeObj.selectedNodes = [uid];
6653
+ }
6645
6654
  treeFolder = true;
6646
6655
  }
6647
6656
  /* istanbul ignore next */
@@ -6899,12 +6908,7 @@ class ContextMenu {
6899
6908
  break;
6900
6909
  case 'paste':
6901
6910
  if (this.menuType === 'folder') {
6902
- if ((this.parent.activeModule === 'largeiconsview') || (this.parent.activeModule === 'detailsview')) {
6903
- this.parent.folderPath = getFullPath(this.parent, this.menuItemData, this.parent.path);
6904
- }
6905
- else {
6906
- this.parent.folderPath = '';
6907
- }
6911
+ this.parent.folderPath = getFullPath(this.parent, this.menuItemData, this.parent.path);
6908
6912
  }
6909
6913
  else {
6910
6914
  this.parent.folderPath = '';