efront 3.22.7 → 3.22.8
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/coms/zimoli/autodragchildren.js +16 -7
- package/coms/zimoli/drag.js +2 -2
- package/coms/zimoli/table.html +2 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -25,9 +25,11 @@ var moveChildrenX = function (targetBox, previousElements, followedElements, mov
|
|
|
25
25
|
var elementPosition = getScreenPosition(element);
|
|
26
26
|
var elementCenter = elementPosition.left + elementPosition.width / 2;
|
|
27
27
|
var delta = elementCenter - (element.moved || 0);
|
|
28
|
-
if (
|
|
28
|
+
if ((!element.hasAttribute || element.hasAttribute('draggable')) && element.draggable === false);
|
|
29
|
+
else if (delta + 2 <= dragPositionLeft) {
|
|
29
30
|
recover(element);
|
|
30
|
-
}
|
|
31
|
+
}
|
|
32
|
+
else if (delta - 2 >= dragPositionLeft) {
|
|
31
33
|
moveMargin(element, dragPosition.width);
|
|
32
34
|
}
|
|
33
35
|
});
|
|
@@ -35,9 +37,11 @@ var moveChildrenX = function (targetBox, previousElements, followedElements, mov
|
|
|
35
37
|
var elementPosition = getScreenPosition(element);
|
|
36
38
|
var elementCenter = elementPosition.left + elementPosition.width / 2;
|
|
37
39
|
var delta = elementCenter - (element.moved || 0);
|
|
38
|
-
if (
|
|
40
|
+
if ((!element.hasAttribute || element.hasAttribute('draggable')) && element.draggable === false);
|
|
41
|
+
else if (delta + 2 <= dragPositionRight) {
|
|
39
42
|
moveMargin(element, -dragPosition.width);
|
|
40
|
-
}
|
|
43
|
+
}
|
|
44
|
+
else if (delta - 2 >= dragPositionRight) {
|
|
41
45
|
recover(element);
|
|
42
46
|
}
|
|
43
47
|
});
|
|
@@ -53,6 +57,10 @@ var moveChildrenX = function (targetBox, previousElements, followedElements, mov
|
|
|
53
57
|
var scrollX = function (targetBox, moveChildren) {
|
|
54
58
|
var dragTarget = drag.target;
|
|
55
59
|
if (!dragTarget || !targetBox) return;
|
|
60
|
+
targetBox = getTargetIn(function (a) {
|
|
61
|
+
var computed = getComputedStyle(a);
|
|
62
|
+
return (computed.overflowX || computed.overflow) !== 'visible' && a.scrollWidth > a.clientWidth;
|
|
63
|
+
}, targetBox);
|
|
56
64
|
var areaPosition = getScreenPosition(targetBox);
|
|
57
65
|
var dragPosition = getScreenPosition(dragTarget);
|
|
58
66
|
var scrollDelta = 0;
|
|
@@ -133,7 +141,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
133
141
|
var [target] = targets;
|
|
134
142
|
return {
|
|
135
143
|
style: target.style, target, getBoundingClientRect,
|
|
136
|
-
with: targets
|
|
144
|
+
with: targets,
|
|
145
|
+
draggable: !target.hasAttribute('draggable') || target.draggable,
|
|
137
146
|
};
|
|
138
147
|
}
|
|
139
148
|
return targets;
|
|
@@ -227,7 +236,6 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
227
236
|
var children = targetBox.children;
|
|
228
237
|
var srcElement = children[src];
|
|
229
238
|
var dstElement = children[dst + delta];
|
|
230
|
-
console.log(targetChild, src)
|
|
231
239
|
src = bindTarget(src, isMovingSource ? targetChild : srcElement);
|
|
232
240
|
dst = bindTarget(dst, dstElement);
|
|
233
241
|
var needFire = !isFunction(move) || move(src, dst, dst + delta, appendSibling, targetBox) !== false;
|
|
@@ -249,7 +257,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
249
257
|
var autoScroll = function () {
|
|
250
258
|
if (autoScroll.ing) return;
|
|
251
259
|
if (scroll) autoScroll.ing = setInterval(function () {
|
|
252
|
-
var delta = scroll(targetBox,
|
|
260
|
+
var delta = scroll(targetBox, dragmove);
|
|
261
|
+
if (isFunction(matcher)) return;
|
|
253
262
|
if (isMovingSource === false) { }
|
|
254
263
|
else if (delta < 0) {
|
|
255
264
|
var p = null;
|
package/coms/zimoli/drag.js
CHANGED
|
@@ -34,14 +34,14 @@ var setZIndex = function () {
|
|
|
34
34
|
};
|
|
35
35
|
function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
36
36
|
if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName) || getTargetIn(a => a.nodrag || a.hasAttribute('nodrag'), initialEvent.target)) return;
|
|
37
|
-
if (target.dragable === false) return;
|
|
38
|
-
initialEvent.preventDefault();
|
|
39
37
|
if (isArray(target)) {
|
|
40
38
|
var extraTargets = target.slice(1);
|
|
41
39
|
target = target[0];
|
|
42
40
|
} else {
|
|
43
41
|
var extraTargets = target.with ? [].concat(target.with) : [];
|
|
44
42
|
}
|
|
43
|
+
if ((!target.hasAttribute || target.hasAttribute('draggable')) && target.draggable === false) return;
|
|
44
|
+
initialEvent.preventDefault();
|
|
45
45
|
var target_offset = getOffset(target);
|
|
46
46
|
var saved_delta = { x: target_offset[0] - initialEvent.screenX, y: target_offset[1] - initialEvent.screenY };
|
|
47
47
|
var clone;
|
package/coms/zimoli/table.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<thead @mounted="setFixedColumn.call(this.parentNode)">
|
|
2
2
|
<tr inline-block #adapter thead @mounted="resizeT(this)">
|
|
3
|
-
<td fixed row-index>序号</td>
|
|
3
|
+
<td draggable="false" fixed row-index>序号</td>
|
|
4
4
|
<td fixed:="f.fixed" -repeat="f in fields track by f.id" :style="{width:f.width}" @dblclick="sort(f)"><i
|
|
5
5
|
-if="f.icon" -class="f.icon"></i><span -if="f.name" -html="f.name"></span><template
|
|
6
6
|
-else> </template>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</thead>
|
|
10
10
|
<tbody -src="(d,i) in data" :style="tbodyHeight(this)">
|
|
11
11
|
<tr inline-block @mounted="this.style.width=adapter.style.width">
|
|
12
|
-
<td fixed row-index -bind="i+1" @mounted="this.style=adapter.firstChild.getAttribute('style')">
|
|
12
|
+
<td draggable="false" fixed row-index -bind="i+1" @mounted="this.style=adapter.firstChild.getAttribute('style')">
|
|
13
13
|
</td>
|
|
14
14
|
<td fixed:="f.fixed" -repeat="(f,i) in fields"
|
|
15
15
|
@mounted="this.style=adapter.children[i+1].getAttribute('style')">
|