@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.
@@ -3057,17 +3057,17 @@ function createAjax(parent, data, fn, event, operation, targetPath) {
3057
3057
  if (isFileSystemData(parent)) {
3058
3058
  var filePath = event === 'node-expand' || event === 'finalize-end' ? getValue('path', data) : parent.path;
3059
3059
  var pathArray = filePath.replace(/^\/|\/$/g, '').split('/');
3060
- var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length != 0)
3060
+ var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length !== 0)
3061
3061
  || (event === 'paste-end' && (parent.targetModule === 'largeiconsview' || parent.targetModule === 'detailsview'))
3062
3062
  ? getValue('data', data)[0].id : pathArray[pathArray.length - 1];
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
3066
  parent.responseData = {
3067
- cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue),
3067
+ cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue),
3068
3068
  details: null,
3069
3069
  error: null,
3070
- files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue)
3070
+ files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event !== 'rename-end-parent' ? 0 : idValue)
3071
3071
  };
3072
3072
  if (isNullOrUndefined(parent.responseData.cwd)) {
3073
3073
  var message = 'Cannot load empty data within the File Manager.';
@@ -6822,6 +6822,16 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
6822
6822
  if (uid === this.parent.pathId[0]) {
6823
6823
  this.disabledItems.push('Delete', 'Rename', 'Cut', 'Copy');
6824
6824
  }
6825
+ else {
6826
+ var itemsToRemove = ['Delete', 'Rename', 'Cut', 'Copy'];
6827
+ for (var i = 0; i < this.disabledItems.length; i++) {
6828
+ var item = this.disabledItems[i];
6829
+ if (itemsToRemove.indexOf(item) !== -1) {
6830
+ this.disabledItems.splice(i, 1);
6831
+ i--;
6832
+ }
6833
+ }
6834
+ }
6825
6835
  /* istanbul ignore next */
6826
6836
  }
6827
6837
  else if (view === 'TreeView' || view === 'GridView' || view === 'LargeIcon') {
@@ -6933,6 +6943,12 @@ var ContextMenu = /** @__PURE__ @class */ (function () {
6933
6943
  if (this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
6934
6944
  this.disabledItems.push('Open');
6935
6945
  }
6946
+ else {
6947
+ var indexToRemove = this.disabledItems.indexOf('Open');
6948
+ if (indexToRemove !== -1) {
6949
+ this.disabledItems.splice(indexToRemove, 1);
6950
+ }
6951
+ }
6936
6952
  if (this.parent.selectedItems.length === 0) {
6937
6953
  var renameIndex = this.disabledItems.indexOf('Rename');
6938
6954
  if (renameIndex !== -1) {
@@ -9484,7 +9500,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
9484
9500
  this.scrollPosition = scroll;
9485
9501
  // Update the list of items and the items property of the largeIconInstance
9486
9502
  this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
9487
- this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ? this.largeIconInstance.itemList.length : this.itemCount;
9503
+ this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ?
9504
+ this.largeIconInstance.itemList.length : this.itemCount;
9488
9505
  this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
9489
9506
  this.itemCount, this.renderedCount);
9490
9507
  };