jqtree 1.8.1 → 1.8.2
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.
- package/bower.json +1 -1
- package/docs/_config.yml +1 -1
- package/docs/_entries/general/changelog.md +4 -0
- package/package.json +1 -1
- package/src/dragAndDropHandler/generateHitAreas.ts +12 -1
- package/src/version.ts +1 -1
- package/tree.jquery.debug.js +13 -3
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +2 -2
- package/tree.jquery.js.map +1 -1
package/bower.json
CHANGED
package/docs/_config.yml
CHANGED
package/package.json
CHANGED
|
@@ -80,6 +80,17 @@ const generatePositions = (tree: Node, currentNode: Node): HitArea[] => {
|
|
|
80
80
|
const handleOpenFolder = (node: Node, element: HTMLElement) => {
|
|
81
81
|
if (node === currentNode) {
|
|
82
82
|
// Cannot move inside current item
|
|
83
|
+
|
|
84
|
+
// Dnd over the current element is not possible: add a position with type None for the top and the bottom.
|
|
85
|
+
const top = getOffsetTop(element);
|
|
86
|
+
const height = element.clientHeight;
|
|
87
|
+
addPosition(node, Position.None, top);
|
|
88
|
+
|
|
89
|
+
if (height > 5) {
|
|
90
|
+
// Subtract 5 pixels to allow more space for the next element.
|
|
91
|
+
addPosition(node, Position.None, top + height - 5);
|
|
92
|
+
}
|
|
93
|
+
|
|
83
94
|
// Stop iterating
|
|
84
95
|
return false;
|
|
85
96
|
}
|
|
@@ -120,7 +131,7 @@ const generateHitAreasForGroup = (
|
|
|
120
131
|
while (i < positionCount) {
|
|
121
132
|
const position = positionsInGroup[i];
|
|
122
133
|
|
|
123
|
-
if (position) {
|
|
134
|
+
if (position && position.position !== Position.None) {
|
|
124
135
|
hitAreas.push({
|
|
125
136
|
top: areaTop,
|
|
126
137
|
bottom: areaTop + areaHeight,
|
package/src/version.ts
CHANGED
package/tree.jquery.debug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
JqTree 1.8.
|
|
2
|
+
JqTree 1.8.2
|
|
3
3
|
|
|
4
4
|
Copyright 2024 Marco Braak
|
|
5
5
|
|
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
|
20
20
|
var jqtree = (function (exports) {
|
|
21
21
|
'use strict';
|
|
22
22
|
|
|
23
|
-
const version = "1.8.
|
|
23
|
+
const version = "1.8.2";
|
|
24
24
|
|
|
25
25
|
let Position = /*#__PURE__*/function (Position) {
|
|
26
26
|
Position[Position["Before"] = 1] = "Before";
|
|
@@ -204,6 +204,16 @@ var jqtree = (function (exports) {
|
|
|
204
204
|
const handleOpenFolder = (node, element) => {
|
|
205
205
|
if (node === currentNode) {
|
|
206
206
|
// Cannot move inside current item
|
|
207
|
+
|
|
208
|
+
// Dnd over the current element is not possible: add a position with type None for the top and the bottom.
|
|
209
|
+
const top = getOffsetTop(element);
|
|
210
|
+
const height = element.clientHeight;
|
|
211
|
+
addPosition(node, Position.None, top);
|
|
212
|
+
if (height > 5) {
|
|
213
|
+
// Subtract 5 pixels to allow more space for the next element.
|
|
214
|
+
addPosition(node, Position.None, top + height - 5);
|
|
215
|
+
}
|
|
216
|
+
|
|
207
217
|
// Stop iterating
|
|
208
218
|
return false;
|
|
209
219
|
}
|
|
@@ -233,7 +243,7 @@ var jqtree = (function (exports) {
|
|
|
233
243
|
let i = 0;
|
|
234
244
|
while (i < positionCount) {
|
|
235
245
|
const position = positionsInGroup[i];
|
|
236
|
-
if (position) {
|
|
246
|
+
if (position && position.position !== Position.None) {
|
|
237
247
|
hitAreas.push({
|
|
238
248
|
top: areaTop,
|
|
239
249
|
bottom: areaTop + areaHeight,
|