@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.
@@ -1313,7 +1313,7 @@ function sortbyClickHandler(parent, args) {
1313
1313
  tick = false;
1314
1314
  }
1315
1315
  if (!tick) {
1316
- parent.sortBy = getSortField(args.item.id);
1316
+ parent.sortBy = getSortField(args.item.id, parent);
1317
1317
  }
1318
1318
  else {
1319
1319
  parent.sortOrder = getSortField(args.item.id);
@@ -1340,12 +1340,24 @@ function sortbyClickHandler(parent, args) {
1340
1340
  * @returns {string} - returns the sorted fields
1341
1341
  * @private
1342
1342
  */
1343
- function getSortField(id) {
1343
+ function getSortField(id, parent) {
1344
1344
  const text = id.substring(id.lastIndexOf('_') + 1);
1345
1345
  let field = text;
1346
+ let column;
1347
+ if (parent) {
1348
+ column = parent.detailsViewSettings.columns;
1349
+ }
1346
1350
  switch (text) {
1347
1351
  case 'date':
1348
- field = '_fm_modified';
1352
+ for (let i = 0, len = column.length; i < len; i++) {
1353
+ if (column[i].field === 'dateModified' || column[i].field === 'dateCreated') {
1354
+ field = column[i].field;
1355
+ break;
1356
+ }
1357
+ else {
1358
+ field = '_fm_modified';
1359
+ }
1360
+ }
1349
1361
  break;
1350
1362
  case 'ascending':
1351
1363
  field = 'Ascending';
@@ -2545,10 +2557,15 @@ function renameSuccess(parent, result, path) {
2545
2557
  const args = { action: 'rename', result: result };
2546
2558
  parent.trigger('success', args);
2547
2559
  parent.renamedItem = result.files[0];
2560
+ if (getValue('filterPath', parent.renamedItem) === getValue('filterPath', parent.itemData[0]) && parent.pathNames.length > 1) {
2561
+ parent.pathNames[parent.pathNames.length - 1] = parent.renameText;
2562
+ }
2548
2563
  if (parent.activeModule === 'navigationpane') {
2549
2564
  parent.pathId.pop();
2550
2565
  parent.itemData = [getValue(parent.pathId[parent.pathId.length - 1], parent.feParent)];
2551
- read(parent, renameEndParent, getParentPath(parent.path));
2566
+ read(parent, renameEndParent, getValue('filterPath', parent.renamedItem).replace(/\\/g, '/'));
2567
+ parent.itemData[0] = parent.renamedItem;
2568
+ read(parent, pathChanged, parent.path === '/' ? parent.path : getValue('filterPath', parent.renamedItem).replace(/\\/g, '/') + parent.renamedItem.name + '/');
2552
2569
  }
2553
2570
  else {
2554
2571
  parent.itemData = [getPathObject(parent)];
@@ -3563,7 +3580,8 @@ function onReSubmit(parent) {
3563
3580
  parent.dialogObj.hide();
3564
3581
  return;
3565
3582
  }
3566
- const newPath = (parent.activeModule === 'navigationpane') ? getParentPath(parent.path) : parent.path;
3583
+ const newPath = (parent.activeModule === 'navigationpane') ? getValue('filterPath', parent.itemData[0]).replace(/\\/g, '/') : parent.path;
3584
+ parent.renamedId = getValue('id', parent.itemData[0]);
3567
3585
  parent.renamedId = getValue('id', parent.itemData[0]);
3568
3586
  if (parent.isFile) {
3569
3587
  const oldExtension = (oIndex === -1) ? '' : parent.currentItemText.substr(oIndex);
@@ -7892,7 +7910,12 @@ class Toolbar$1 {
7892
7910
  items[itemCount].iconCss = this.parent.sortBy === 'size' ? TB_OPTION_DOT : '';
7893
7911
  }
7894
7912
  else if (items[itemCount].id === this.getPupupId('date')) {
7895
- items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7913
+ if (this.parent.sortBy === 'dateModified' || this.parent.sortBy === 'dateCreated') {
7914
+ items[itemCount].iconCss = this.parent.sortBy === this.parent.sortBy ? TB_OPTION_DOT : '';
7915
+ }
7916
+ else {
7917
+ items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7918
+ }
7896
7919
  }
7897
7920
  else if (items[itemCount].id === this.getPupupId('ascending')) {
7898
7921
  items[itemCount].iconCss = this.parent.sortOrder === 'Ascending' ? TB_OPTION_TICK : '';
@@ -8425,6 +8448,7 @@ class NavigationPane {
8425
8448
  this.isRenameParent = false;
8426
8449
  this.isRightClick = false;
8427
8450
  this.isSameNodeClicked = false;
8451
+ this.isNodeExpandCalled = false;
8428
8452
  this.renameParent = null;
8429
8453
  // Specifies the previously selected nodes in the treeview control.
8430
8454
  this.previousSelected = null;
@@ -8595,7 +8619,7 @@ class NavigationPane {
8595
8619
  const selecEventArgs = { action: args.action, fileDetails: nodeData[0], isInteracted: args.isInteracted };
8596
8620
  this.parent.trigger('fileSelect', selecEventArgs);
8597
8621
  }
8598
- if (!this.isRightClick) {
8622
+ if (!this.isRightClick && args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1]) {
8599
8623
  const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8600
8624
  this.parent.trigger('fileOpen', eventArgs);
8601
8625
  args.cancel = eventArgs.cancel;
@@ -8693,12 +8717,14 @@ class NavigationPane {
8693
8717
  this.parent.expandedId = this.expandNodeTarget;
8694
8718
  this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
8695
8719
  read(this.parent, nodeExpand, path);
8720
+ this.isNodeExpandCalled = true;
8696
8721
  }
8697
8722
  }
8698
8723
  /* istanbul ignore next */
8699
8724
  onNodeExpanded(args) {
8700
8725
  this.addChild(args.files, this.expandNodeTarget, false);
8701
8726
  this.parent.expandedId = null;
8727
+ this.isNodeExpandCalled = false;
8702
8728
  }
8703
8729
  onNodeClicked(args) {
8704
8730
  this.parent.activeModule = 'navigationpane';
@@ -8714,7 +8740,7 @@ class NavigationPane {
8714
8740
  const layout = (this.parent.view === 'LargeIcons') ? 'largeiconsview' : 'detailsview';
8715
8741
  this.parent.notify(modelChanged, { module: layout, newProp: { selectedItems: [] } });
8716
8742
  }
8717
- else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && !this.isNodeClickCalled) {
8743
+ else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && !this.isNodeClickCalled && !this.isNodeExpandCalled) {
8718
8744
  if (args.event.which === 3) {
8719
8745
  this.isRightClick = true;
8720
8746
  }