@syncfusion/ej2-filemanager 20.1.60 → 20.2.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.
@@ -881,7 +881,7 @@ function searchWordHandler(parent, value, isLayoutChange) {
881
881
  else {
882
882
  if (!parent.isFiltered) {
883
883
  if (parent.isSortByClicked) {
884
- parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
884
+ parent.notify(layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.items });
885
885
  parent.isSortByClicked = false;
886
886
  }
887
887
  else {
@@ -902,6 +902,7 @@ function searchWordHandler(parent, value, isLayoutChange) {
902
902
  * @private
903
903
  */
904
904
  function updateLayout(parent, view) {
905
+ parent.oldView = parent.view;
905
906
  parent.setProperties({ view: view }, true);
906
907
  if (parent.breadcrumbbarModule.searchObj.element.value !== '' || parent.isFiltered) {
907
908
  parent.layoutSelectedItems = parent.selectedItems;
@@ -1305,7 +1306,7 @@ function sortbyClickHandler(parent, args) {
1305
1306
  tick = false;
1306
1307
  }
1307
1308
  if (!tick) {
1308
- parent.sortBy = getSortField(args.item.id, parent);
1309
+ parent.sortBy = getSortField(args.item.id);
1309
1310
  }
1310
1311
  else {
1311
1312
  parent.sortOrder = getSortField(args.item.id);
@@ -1319,7 +1320,9 @@ function sortbyClickHandler(parent, args) {
1319
1320
  parent.notify(sortColumn, { module: 'detailsview' });
1320
1321
  }
1321
1322
  }
1322
- updateLayout(parent, parent.view);
1323
+ if (parent.view === 'LargeIcons') {
1324
+ updateLayout(parent, 'LargeIcons');
1325
+ }
1323
1326
  parent.notify(sortByChange, {});
1324
1327
  }
1325
1328
  /**
@@ -1329,24 +1332,12 @@ function sortbyClickHandler(parent, args) {
1329
1332
  * @returns {string} - returns the sorted fields
1330
1333
  * @private
1331
1334
  */
1332
- function getSortField(id, parent) {
1335
+ function getSortField(id) {
1333
1336
  const text = id.substring(id.lastIndexOf('_') + 1);
1334
1337
  let field = text;
1335
- let column;
1336
- if (parent) {
1337
- column = parent.detailsViewSettings.columns;
1338
- }
1339
1338
  switch (text) {
1340
1339
  case 'date':
1341
- for (var i = 0; i < column.length; i++) {
1342
- if (column[i].field === 'dateModified' || column[i].field === 'dateCreated') {
1343
- field = column[i].field;
1344
- break;
1345
- }
1346
- else {
1347
- field = '_fm_modified';
1348
- }
1349
- }
1340
+ field = '_fm_modified';
1350
1341
  break;
1351
1342
  case 'ascending':
1352
1343
  field = 'Ascending';
@@ -3394,11 +3385,18 @@ function getOptions(parent, text, e, details, replaceItems) {
3394
3385
  ];
3395
3386
  break;
3396
3387
  case 'MultipleFileDetails':
3388
+ let index;
3397
3389
  options.dialogName = 'File Details';
3398
- strArr = details.name.split(',').map((val) => {
3399
- const index = val.indexOf('.') + 1;
3400
- return (index === 0) ? 'Folder' : val.substr(index).replace(' ', '');
3390
+ strArr = parent.itemData.map((val) => {
3391
+ index = val.name.indexOf('.') + 1;
3392
+ return (index === 0 && (!val.isFile)) ? 'Folder' : ((index !== 0) ? val.name.substr(index).replace(' ', '') : 'undetermined');
3401
3393
  });
3394
+ if (strArr[0] == undefined) {
3395
+ strArr = details.name.split(',').map((val) => {
3396
+ index = val.indexOf('.') + 1;
3397
+ return (index === 0) ? 'Folder' : val.substr(index).replace(' ', '');
3398
+ });
3399
+ }
3402
3400
  fileType$$1 = strArr.every((val, i, arr) => val === arr[0]) ?
3403
3401
  ((strArr[0] === 'Folder') ? 'Folder' : strArr[0].toLocaleUpperCase() + ' Type') : 'Multiple Types';
3404
3402
  location = details.location;
@@ -6433,7 +6431,7 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6433
6431
  this.droppedObjects = [];
6434
6432
  this.uploadingCount = 0;
6435
6433
  this.uploadedCount = 0;
6436
- //Specifies whether the operating system is MAC or not
6434
+ //Specifies whether the operating system is MAC or not
6437
6435
  this.isMac = false;
6438
6436
  FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu$2);
6439
6437
  }
@@ -7821,12 +7819,7 @@ class Toolbar$1 {
7821
7819
  items[itemCount].iconCss = this.parent.sortBy === 'size' ? TB_OPTION_DOT : '';
7822
7820
  }
7823
7821
  else if (items[itemCount].id === this.getPupupId('date')) {
7824
- if (this.parent.sortBy === 'dateModified' || this.parent.sortBy === 'dateCreated') {
7825
- items[itemCount].iconCss = this.parent.sortBy === this.parent.sortBy ? TB_OPTION_DOT : '';
7826
- }
7827
- else {
7828
- items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7829
- }
7822
+ items[itemCount].iconCss = this.parent.sortBy === '_fm_modified' ? TB_OPTION_DOT : '';
7830
7823
  }
7831
7824
  else if (items[itemCount].id === this.getPupupId('ascending')) {
7832
7825
  items[itemCount].iconCss = this.parent.sortOrder === 'Ascending' ? TB_OPTION_TICK : '';
@@ -8386,7 +8379,7 @@ class NavigationPane {
8386
8379
  const currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
8387
8380
  if (this.expandNodeTarget === 'add') {
8388
8381
  const sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
8389
- const ul = select('.' + LIST_PARENT, sNode);
8382
+ const ul = (!isNullOrUndefined(sNode)) ? select('.' + LIST_PARENT, sNode) : null;
8390
8383
  if (isNullOrUndefined(ul)) {
8391
8384
  this.addChild(args.files, this.treeObj.selectedNodes[0], !this.expandTree);
8392
8385
  }