@syncfusion/ej2-filemanager 21.1.37 → 21.1.39

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.
@@ -1457,7 +1457,7 @@ function sortbyClickHandler(parent, args) {
1457
1457
  tick = false;
1458
1458
  }
1459
1459
  if (!tick) {
1460
- parent.sortBy = getSortField(args.item.id);
1460
+ parent.sortBy = getSortField(args.item.id, parent);
1461
1461
  }
1462
1462
  else {
1463
1463
  parent.sortOrder = getSortField(args.item.id);
@@ -1484,12 +1484,24 @@ function sortbyClickHandler(parent, args) {
1484
1484
  * @returns {string} - returns the sorted fields
1485
1485
  * @private
1486
1486
  */
1487
- function getSortField(id) {
1487
+ function getSortField(id, parent) {
1488
1488
  var text = id.substring(id.lastIndexOf('_') + 1);
1489
1489
  var field = text;
1490
+ var column;
1491
+ if (parent) {
1492
+ column = parent.detailsViewSettings.columns;
1493
+ }
1490
1494
  switch (text) {
1491
1495
  case 'date':
1492
- field = '_fm_modified';
1496
+ for (var i = 0, len = column.length; i < len; i++) {
1497
+ if (column[i].field === 'dateModified' || column[i].field === 'dateCreated') {
1498
+ field = column[i].field;
1499
+ break;
1500
+ }
1501
+ else {
1502
+ field = '_fm_modified';
1503
+ }
1504
+ }
1493
1505
  break;
1494
1506
  case 'ascending':
1495
1507
  field = 'Ascending';
@@ -2689,10 +2701,15 @@ function renameSuccess(parent, result, path) {
2689
2701
  var args = { action: 'rename', result: result };
2690
2702
  parent.trigger('success', args);
2691
2703
  parent.renamedItem = result.files[0];
2704
+ if (getValue('filterPath', parent.renamedItem) === getValue('filterPath', parent.itemData[0]) && parent.pathNames.length > 1) {
2705
+ parent.pathNames[parent.pathNames.length - 1] = parent.renameText;
2706
+ }
2692
2707
  if (parent.activeModule === 'navigationpane') {
2693
2708
  parent.pathId.pop();
2694
2709
  parent.itemData = [getValue(parent.pathId[parent.pathId.length - 1], parent.feParent)];
2695
- read(parent, renameEndParent, getParentPath(parent.path));
2710
+ read(parent, renameEndParent, getValue('filterPath', parent.renamedItem).replace(/\\/g, '/'));
2711
+ parent.itemData[0] = parent.renamedItem;
2712
+ read(parent, pathChanged, parent.path === '/' ? parent.path : getValue('filterPath', parent.renamedItem).replace(/\\/g, '/') + parent.renamedItem.name + '/');
2696
2713
  }
2697
2714
  else {
2698
2715
  parent.itemData = [getPathObject(parent)];
@@ -3710,7 +3727,8 @@ function onReSubmit(parent) {
3710
3727
  parent.dialogObj.hide();
3711
3728
  return;
3712
3729
  }
3713
- var newPath = (parent.activeModule === 'navigationpane') ? getParentPath(parent.path) : parent.path;
3730
+ var newPath = (parent.activeModule === 'navigationpane') ? getValue('filterPath', parent.itemData[0]).replace(/\\/g, '/') : parent.path;
3731
+ parent.renamedId = getValue('id', parent.itemData[0]);
3714
3732
  parent.renamedId = getValue('id', parent.itemData[0]);
3715
3733
  if (parent.isFile) {
3716
3734
  var oldExtension = (oIndex === -1) ? '' : parent.currentItemText.substr(oIndex);
@@ -8074,7 +8092,12 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
8074
8092
  items[itemCount].iconCss = this.parent.sortBy === 'size' ? TB_OPTION_DOT : '';
8075
8093
  }
8076
8094
  else if (items[itemCount].id === this.getPupupId('date')) {
8077
- items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
8095
+ if (this.parent.sortBy === 'dateModified' || this.parent.sortBy === 'dateCreated') {
8096
+ items[itemCount].iconCss = this.parent.sortBy === this.parent.sortBy ? TB_OPTION_DOT : '';
8097
+ }
8098
+ else {
8099
+ items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
8100
+ }
8078
8101
  }
8079
8102
  else if (items[itemCount].id === this.getPupupId('ascending')) {
8080
8103
  items[itemCount].iconCss = this.parent.sortOrder === 'Ascending' ? TB_OPTION_TICK : '';
@@ -8613,6 +8636,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8613
8636
  this.isRenameParent = false;
8614
8637
  this.isRightClick = false;
8615
8638
  this.isSameNodeClicked = false;
8639
+ this.isNodeExpandCalled = false;
8616
8640
  this.renameParent = null;
8617
8641
  // Specifies the previously selected nodes in the treeview control.
8618
8642
  this.previousSelected = null;
@@ -8784,7 +8808,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8784
8808
  var selecEventArgs = { action: args.action, fileDetails: nodeData[0], isInteracted: args.isInteracted };
8785
8809
  this.parent.trigger('fileSelect', selecEventArgs);
8786
8810
  }
8787
- if (!this.isRightClick) {
8811
+ if (!this.isRightClick && args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1]) {
8788
8812
  var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8789
8813
  this.parent.trigger('fileOpen', eventArgs);
8790
8814
  args.cancel = eventArgs.cancel;
@@ -8882,12 +8906,14 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8882
8906
  this.parent.expandedId = this.expandNodeTarget;
8883
8907
  this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
8884
8908
  read(this.parent, nodeExpand, path);
8909
+ this.isNodeExpandCalled = true;
8885
8910
  }
8886
8911
  };
8887
8912
  /* istanbul ignore next */
8888
8913
  NavigationPane.prototype.onNodeExpanded = function (args) {
8889
8914
  this.addChild(args.files, this.expandNodeTarget, false);
8890
8915
  this.parent.expandedId = null;
8916
+ this.isNodeExpandCalled = false;
8891
8917
  };
8892
8918
  NavigationPane.prototype.onNodeClicked = function (args) {
8893
8919
  this.parent.activeModule = 'navigationpane';
@@ -8903,7 +8929,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8903
8929
  var layout = (this.parent.view === 'LargeIcons') ? 'largeiconsview' : 'detailsview';
8904
8930
  this.parent.notify(modelChanged, { module: layout, newProp: { selectedItems: [] } });
8905
8931
  }
8906
- else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && !this.isNodeClickCalled) {
8932
+ else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && !this.isNodeClickCalled && !this.isNodeExpandCalled) {
8907
8933
  if (args.event.which === 3) {
8908
8934
  this.isRightClick = true;
8909
8935
  }