@syncfusion/ej2-filemanager 26.2.5 → 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.
@@ -3063,11 +3063,17 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
3063
3063
  var action = getValue('action', data);
3064
3064
  var isFileOperation = (action === 'move' || action === 'rename' || action === 'copy' || action === 'delete' || action === 'search') && event !== 'rename-end';
3065
3065
  if (action === 'read' || action === 'create' || event === 'rename-end') {
3066
+ var rootId = parent.fileSystemData
3067
+ .filter(function (item) { return isNullOrUndefined(item.parentId); })
3068
+ .length > 0
3069
+ ? parent.fileSystemData
3070
+ .filter(function (item) { return isNullOrUndefined(item.parentId); })[0].id
3071
+ : 0;
3066
3072
  parent.responseData = {
3067
- cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue),
3073
+ cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? rootId : idValue),
3068
3074
  details: null,
3069
3075
  error: null,
3070
- files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue)
3076
+ files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? rootId : idValue)
3071
3077
  };
3072
3078
  if (isNullOrUndefined(parent.responseData.cwd)) {
3073
3079
  var message = 'Cannot load empty data within the File Manager.';
@@ -6805,6 +6811,9 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
6805
6811
  }
6806
6812
  else if (closest(target, '#' + this.parent.element.id + TREE_ID)) {
6807
6813
  uid = closest(target, 'li').getAttribute('data-uid');
6814
+ if (!isNullOrUndefined(uid)) {
6815
+ this.parent.navigationpaneModule.treeObj.selectedNodes = [uid];
6816
+ }
6808
6817
  treeFolder = true;
6809
6818
  }
6810
6819
  /* istanbul ignore next */
@@ -7063,12 +7072,7 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
7063
7072
  break;
7064
7073
  case 'paste':
7065
7074
  if (_this.menuType === 'folder') {
7066
- if ((_this.parent.activeModule === 'largeiconsview') || (_this.parent.activeModule === 'detailsview')) {
7067
- _this.parent.folderPath = getFullPath(_this.parent, _this.menuItemData, _this.parent.path);
7068
- }
7069
- else {
7070
- _this.parent.folderPath = '';
7071
- }
7075
+ _this.parent.folderPath = getFullPath(_this.parent, _this.menuItemData, _this.parent.path);
7072
7076
  }
7073
7077
  else {
7074
7078
  _this.parent.folderPath = '';