@syncfusion/ej2-filemanager 24.1.41 → 24.1.44

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.
@@ -1914,6 +1914,30 @@ function removeItemClass(parent, value) {
1914
1914
  ele[i].classList.remove(value);
1915
1915
  }
1916
1916
  }
1917
+ /**
1918
+ * Remove item class handler
1919
+ *
1920
+ * @param {Element} scrollParent - specifies the scrolling target.
1921
+ * @param {IFileManager} parent - specifies the parent.
1922
+ * @param {string} nodeClass - specifies the node class.
1923
+ * @param {number} screenY - specifies the vertical (Y) coordinate of the mouse cursor position relative to the entire screen.
1924
+ * @param {number} clientY - specifies the vertical (Y) coordinate of the mouse cursor position relative to the target element.
1925
+ * @returns {void}
1926
+ * @private
1927
+ */
1928
+ function scrollHandler(scrollParent, parent, nodeClass, screenY, clientY) {
1929
+ let position;
1930
+ let elementData = scrollParent.getBoundingClientRect();
1931
+ const node = select("." + nodeClass, scrollParent);
1932
+ if ((screenY >= (elementData.top + scrollParent.clientHeight - 30)) && !isNullOrUndefined(node)) {
1933
+ position = (parent.targetModule === 'navigationpane' || parent.targetModule === 'detailsview') ? node.offsetHeight / 2.5 : node.offsetHeight / 4.5;
1934
+ scrollParent.scrollBy(0, position);
1935
+ }
1936
+ if (!isNullOrUndefined(node) && (clientY <= (elementData.top + 30))) {
1937
+ position = (parent.targetModule === 'navigationpane' || parent.targetModule === 'detailsview') ? node.offsetHeight / 2.5 : node.offsetHeight / 4.5;
1938
+ scrollParent.scrollBy(0, -position);
1939
+ }
1940
+ }
1917
1941
  /**
1918
1942
  * Dragging handler
1919
1943
  *
@@ -1934,12 +1958,15 @@ function draggingHandler(parent, args) {
1934
1958
  }
1935
1959
  removeBlur(parent, 'hover');
1936
1960
  let node = null;
1961
+ let scrollParent;
1937
1962
  if (parent.targetModule === 'navigationpane') {
1938
1963
  node = closest(args.target, 'li');
1939
1964
  node.classList.add(HOVER, DROP_FOLDER);
1940
1965
  canDrop = true;
1941
1966
  /* istanbul ignore next */
1942
1967
  parent.treeExpandTimer = window.setTimeout(() => { parent.notify(dragging, args); }, 800);
1968
+ scrollParent = parent.navigationpaneModule.treeObj.element.parentElement;
1969
+ scrollHandler(scrollParent, parent, 'e-level-2', args.event.screenY, args.event.y);
1943
1970
  }
1944
1971
  else if (parent.targetModule === 'detailsview') {
1945
1972
  node = closest(args.target, 'tr');
@@ -1950,6 +1977,8 @@ function draggingHandler(parent, args) {
1950
1977
  node.classList.add(DROP_FILE);
1951
1978
  }
1952
1979
  canDrop = true;
1980
+ scrollParent = parent.detailsviewModule.gridObj.element.querySelector('.e-content');
1981
+ scrollHandler(scrollParent, parent, 'e-row', args.event.screenY, args.event.y);
1953
1982
  }
1954
1983
  else if (parent.targetModule === 'largeiconsview') {
1955
1984
  node = closest(args.target, 'li');
@@ -1957,6 +1986,8 @@ function draggingHandler(parent, args) {
1957
1986
  node.classList.add(HOVER, DROP_FOLDER);
1958
1987
  }
1959
1988
  canDrop = true;
1989
+ scrollParent = parent.largeiconsviewModule.element.firstElementChild;
1990
+ scrollHandler(scrollParent, parent, 'e-large-icon', args.event.screenY, args.event.y);
1960
1991
  /* istanbul ignore next */
1961
1992
  }
1962
1993
  else if (parent.targetModule === 'breadcrumbbar') {
@@ -4035,7 +4066,7 @@ class LargeIconsView {
4035
4066
  this.dragObj = new Draggable(this.listElements, {
4036
4067
  enableTailMode: true,
4037
4068
  distance: 5,
4038
- enableAutoScroll: true,
4069
+ enableAutoScroll: false,
4039
4070
  dragTarget: '.' + LARGE_ICON,
4040
4071
  helper: this.dragHelper.bind(this),
4041
4072
  cursorAt: this.parent.dragCursorPosition,
@@ -8451,6 +8482,9 @@ class Virtualization {
8451
8482
  this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
8452
8483
  // Append the list element to the large icon element
8453
8484
  this.largeIconInstance.element.appendChild(listElements);
8485
+ if (this.itemList.length !== 0 && this.largeIconInstance.element.querySelector('.' + EMPTY)) {
8486
+ this.largeIconInstance.element.removeChild(this.largeIconInstance.element.querySelector('.' + EMPTY));
8487
+ }
8454
8488
  // Get the total number of items
8455
8489
  this.itemCount = this.getItemCount(Object.keys(this.largeIconInstance.allItems).length);
8456
8490
  // Remove the first child element from the large icon element
@@ -8779,7 +8813,7 @@ class NavigationPane {
8779
8813
  },
8780
8814
  dragStop: dragStopHandler.bind(this, this.parent),
8781
8815
  enableTailMode: true,
8782
- enableAutoScroll: true,
8816
+ enableAutoScroll: false,
8783
8817
  helper: this.dragHelper.bind(this)
8784
8818
  });
8785
8819
  }
@@ -8933,7 +8967,7 @@ class NavigationPane {
8933
8967
  this.parent.itemData = nodeData;
8934
8968
  const previousPath = this.parent.path;
8935
8969
  const sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
8936
- if (!this.isRightClick && this.isSameNodeClicked && sNode.querySelector('.e-list-text').innerHTML !== this.parent.pathNames[this.parent.pathNames.length - 1]) {
8970
+ if (!this.isRightClick && this.isSameNodeClicked) {
8937
8971
  updatePath(args.node, this.parent.itemData[0], this.parent);
8938
8972
  }
8939
8973
  else {
@@ -10594,7 +10628,7 @@ class DetailsView {
10594
10628
  dragStartHandler(this.parent, args, this.dragObj);
10595
10629
  },
10596
10630
  dragStop: dragStopHandler.bind(this, this.parent),
10597
- enableAutoScroll: true,
10631
+ enableAutoScroll: false,
10598
10632
  helper: this.dragHelper.bind(this)
10599
10633
  });
10600
10634
  }