efront 3.31.2 → 3.33.0

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.
@@ -3,10 +3,10 @@ function autofocus(e) {
3
3
  var savedElement;
4
4
  e.renders.push(function () {
5
5
  var parent = rootElements[rootElements.length - 1] || document.body;
6
- if (savedElement === parent) {
6
+ if (savedElement === this) {
7
7
  if (this !== parent || getTargetIn(parent, document.activeElement)) return;
8
8
  }
9
- savedElement = parent;
9
+ savedElement = this;
10
10
  if (/^(input|textarea)$/i.test(this.tagName) || /^true$/.test(this.contentEditable)) {
11
11
  if (getTargetIn(parent, this)) {
12
12
  this.focus();
@@ -8,7 +8,7 @@ function chooseFile(accept, multiple, extra) {
8
8
  // focus 事件比change事件早40-80毫秒
9
9
  if (opened && document.hasFocus()) {
10
10
  remove(input);
11
- setTimeout(oh, 210);
11
+ setTimeout(oh, 610);
12
12
  }
13
13
  };
14
14
  on("change")(input, function () {
@@ -82,6 +82,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
82
82
  extraClones.map(c => document.body.appendChild(c));
83
83
  saved_delta.x += clone_left - target_left;
84
84
  saved_delta.y += clone_top - target_top;
85
+ target.setAttribute("dragging", '');
85
86
  dispatch("dragstart", target);
86
87
  }
87
88
  event.moveLocked = true;
@@ -106,7 +107,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
106
107
  if (clone !== target) remove(clone), css(target, { opacity: saved_opacity, filter: saved_filter });
107
108
  remove(extraClones);
108
109
  extraTargets.map((target, cx) => css(target, extraStyles[cx]));
109
- if (saved_delta.ing) dispatch("dragend", target);
110
+ if (saved_delta.ing) target.removeAttribute("dragging"), dispatch("dragend", target);
110
111
  drag.target = null;
111
112
  saved_delta = null;
112
113
  };
@@ -67,7 +67,7 @@
67
67
  content: "";
68
68
  border-radius: 50%;
69
69
  color: inherit;
70
- border: 1em solid ;
70
+ border: 2px solid ;
71
71
  border-right-color: transparent;
72
72
  border-top-color: transparent;
73
73
  overflow: hidden;
@@ -182,7 +182,6 @@ function maps(config = {}) {
182
182
  var reshape = function () {
183
183
  canvas.width = canvas.offsetWidth;
184
184
  canvas.height = canvas.offsetHeight;
185
- console.log(canvas.map)
186
185
  canvas.map.refresh();
187
186
  canvas._default = canvas.map.defaultImage();
188
187
  };
@@ -14,7 +14,9 @@ var copyAttribute = function (node, copys) {
14
14
  node[name] = value;
15
15
  break;
16
16
  default:
17
- node.setAttribute(name, value);
17
+ if (isFunction(node.setAttribute)) {
18
+ node.setAttribute(name, value);
19
+ }
18
20
  }
19
21
  }
20
22
  var createTemplateNodes = function (text) {
@@ -41,6 +41,9 @@ var getResizer = function (event) {
41
41
  if (fringe.cursor || getTargetIn(rect.dragHandle, event.target)) {
42
42
  var { resize } = fringe;
43
43
  extend(resize, getScreenPosition(rect));
44
+ var computedStyle = getComputedStyle(rect);
45
+ resize.width = parseFloat(computedStyle.width);
46
+ resize.height = parseFloat(computedStyle.height);
44
47
  resize.rect = rect;
45
48
  resize.cursor = fringe.cursor;
46
49
  return resize;
@@ -53,6 +56,7 @@ var handle = {
53
56
  dragging = getResizer(event);
54
57
  if (!dragging) return;
55
58
  var elem = dragging.rect;
59
+ if (elem.setAttribute) elem.setAttribute("resizing", '');
56
60
  if (elem.offsetParent && /^(absolute|fixed|relative)$/i.test(getComputedStyle(elem.offsetParent).position)) {
57
61
  var parent = elem.offsetParent;
58
62
  var pos = getScreenPosition(parent);
@@ -131,6 +135,9 @@ var handle = {
131
135
  resizingList.hit(rect);
132
136
  },
133
137
  end(e) {
138
+ if (dragging && dragging.rect.removeAttribute) {
139
+ dragging.rect.removeAttribute("resizing");
140
+ }
134
141
  dragging = null;
135
142
  }
136
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.31.2",
3
+ "version": "3.33.0",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {