efront 4.22.12 → 4.22.13

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.
@@ -1,3 +1,6 @@
1
+ - zh-CN: "参数异常: $1"
2
+ en: "Parameter exception: $1"
3
+
1
4
  - zh-CN: 此数据不可查询!
2
5
  en: This data is not searchable!
3
6
 
package/apps/_index.html CHANGED
@@ -1,6 +1,10 @@
1
1
  <!DOCTYPE html>
2
2
  <!--
3
3
  http://efront.cc
4
+ 乌鸦不是钟楼燕
5
+ 筑巢不下尖尾檐
6
+ 雨打风摇三冬寒
7
+ 不去南方不需还
4
8
  -->
5
9
  <html lang="zh-CN">
6
10
 
@@ -0,0 +1,68 @@
1
+ function combgeta(args) {
2
+ if (typeof args[0] === "function") return [args[0], Array.prototype.slice.call(args, 1)];
3
+ if (typeof args[args.length - 1] === "function") return [args[args.length - 1], Array.prototype.slice.call(args, 0, args.length - 1)];
4
+ return [null, args];
5
+ }
6
+
7
+ function getRatiosList(argsList, total) {
8
+ return argsList.map(a => total = total / a.length);
9
+ }
10
+ function rangeAt(i) {
11
+ if (i < 0 || i > this.length) return;
12
+ var { source, ratios, format } = this;
13
+ var args = source.map(function (a, cx) {
14
+ var index = i / ratios[cx] | 0;
15
+ i = i - index * ratios[cx];
16
+ return a.start + index * a.step;
17
+ });
18
+ if (format) format(args);
19
+ return args;
20
+ }
21
+ function itemAt(i) {
22
+ if (i < 0 || i > this.length) return;
23
+ var { source, ratios, format } = this;
24
+ var args = source.map(function (a, cx) {
25
+ var index = i / ratios[cx] | 0;
26
+ i = i - index * ratios[cx];
27
+ return a[index];
28
+ });
29
+ if (format) args = format(args);
30
+ return args;
31
+ }
32
+
33
+ class Comb {
34
+ static args = combgeta;
35
+ constructor() {
36
+ var f, args, srcIsRange;
37
+ for (var a of arguments) {
38
+ switch (typeof a) {
39
+ case "boolean": srcIsRange = a; break;
40
+ case "object": args = a; break;
41
+ case "function": f = a; break;
42
+ default: throw new Error(i18n`参数异常: ${a}`);
43
+ }
44
+
45
+ }
46
+ this.format = f;
47
+ var total = 1;
48
+ if (srcIsRange) {
49
+ this.source = Array.prototype.map.call(args, a => {
50
+ var [s, e, t = 1] = a;
51
+ var r = (1 + e - s) / t;
52
+ total *= r;
53
+ return { length: r, start: s, end: e, step: t };
54
+ });
55
+ this.get = rangeAt;
56
+ }
57
+ else {
58
+ this.source = Array.prototype.map.call(args, a => {
59
+ total *= a.length;
60
+ return a;
61
+ });
62
+ this.get = itemAt;
63
+ }
64
+ this.ratios = getRatiosList(this.source, total);
65
+ this.length = total;
66
+ }
67
+ }
68
+ module.exports = Comb;
@@ -14,6 +14,11 @@ function inertia(gun) {
14
14
  lastTime = Speed.now() - 1;
15
15
  _decrease0();
16
16
  }
17
+ var park = function () {
18
+ train.state = 停止;
19
+ if (isFunction(train.park)) train.park();
20
+ };
21
+
17
22
  var _decrease0 = function () {
18
23
  if (
19
24
  decrease instanceof Function
@@ -26,11 +31,14 @@ function inertia(gun) {
26
31
  if (smooth_timer !== id) return;
27
32
  if (res === false || isEmpty(res)) {
28
33
  spd.unset();
29
- train.state = 停止;
34
+ park();
30
35
  return;
31
36
  }
32
37
  smooth_timer = requestAnimationFrame(_decrease0);
33
38
  }
39
+ else {
40
+ park();
41
+ }
34
42
  };
35
43
  var _cancel = function () {
36
44
  cancelAnimationFrame(smooth_timer);
@@ -50,7 +58,7 @@ function inertia(gun) {
50
58
  }
51
59
  if (args.stop || rate && args.rate < rate) {
52
60
  if (!decrease) {
53
- train.state = 停止;
61
+ park();
54
62
  return;
55
63
  }
56
64
  train.state = 回弹;
@@ -70,6 +78,9 @@ function inertia(gun) {
70
78
  };
71
79
  train.smooth = function (d, r) {
72
80
  _cancel();
81
+ if (isFunction(d) && !isFinite(r)) {
82
+ r = 1;
83
+ }
73
84
  decrease = d;
74
85
  rate = r;
75
86
  if (train.state === 移动) {
@@ -1,23 +1,13 @@
1
1
  function* combgen() {
2
- var total = 1;
3
- var argsList = Array.prototype.map.call(arguments, a => {
4
- total *= a.length;
5
- return a;
6
- });
7
- var temp = total;
8
- var ratioList = argsList.map(a => temp = temp / a.length);
2
+ var [f, args] = Comb.args(arguments);
3
+ var arr = new Comb(f, args);
9
4
  var i = 0;
10
- for (var cx = 0, dx = total; cx < dx; cx++) {
11
- var temp = cx;
12
- var res = yield argsList.map(function (a, cx) {
13
- var index = temp / ratioList[cx] | 0;
14
- temp = temp - index * ratioList[cx];
15
- return a[index];
16
- });
5
+ for (var cx = 0, dx = arr.length; cx < dx; cx++) {
6
+ var res = yield arr.get(cx);
17
7
  if (res === false) {
18
8
  i++;
19
- if (i > argsList.length) break;
20
- var tx = argsList[argsList.length - i].length;
9
+ if (i > args.length) break;
10
+ var tx = args[args.length - i].length;
21
11
  cx += tx - cx % tx - 1;
22
12
  }
23
13
  else {
@@ -1,20 +1,10 @@
1
+ var Comb = require("./Comb");
1
2
  function combine() {
2
- var total = 1;
3
- var argsList = Array.prototype.map.call(arguments, a => {
4
- total *= a.length;
5
- return a;
6
- });
7
-
8
- var temp = total;
9
- var ratioList = argsList.map(a => temp = temp / a.length);
10
- var dist = new Array(total);
11
- for (var cx = 0, dx = total; cx < dx; cx++) {
12
- var temp = cx;
13
- dist[cx] = argsList.map(function (a, cx) {
14
- var index = temp / ratioList[cx] | 0;
15
- temp = temp - index * ratioList[cx];
16
- return a[index];
17
- });
3
+ var [f, args] = Comb.args(arguments);
4
+ var arr = new Comb(f, args);
5
+ var dist = new Array(arr.length);
6
+ for (var cx = 0, dx = arr.length; cx < dx; cx++) {
7
+ dist[cx] = arr.get(cx);
18
8
  }
19
9
  return dist;
20
10
  }
@@ -443,7 +443,8 @@ function addhook() {
443
443
  }
444
444
  if (!mousedownEvent) return;
445
445
  var target = targetElement || mousedownEvent.currentTarget;
446
- hooka.call(targetElement, function (target) {
446
+ hooka.call(targetElement, function () {
447
+ var target = drag.shadow;
447
448
  var res = Array.prototype.filter.call(allowdrops || (boxfinder ? boxfinder(target) : document.querySelectorAll("[allowdrop]")), function (child) {
448
449
  return target && overlap(child, target);
449
450
  }).filter(e => {
@@ -67,8 +67,10 @@ var getGenerator = function (container, tagName = 'item') {
67
67
  */
68
68
  return container.$generator = function (index, com, element) {
69
69
  if (com === undefined) {
70
- if (!container.src || index >= container.src.length) return;
71
- com = container.src[index];
70
+ var src = container.src;
71
+ if (!src || index >= src.length) return;
72
+ if (isFunction(src.get)) com = src.get(index);
73
+ else com = src[index];
72
74
  }
73
75
  if (com === undefined) return;
74
76
  if (isNode(element));
@@ -51,16 +51,18 @@ function ylist(container, generator, $Y) {
51
51
  }
52
52
  return null;
53
53
  };
54
+ var isSticky = child => isNode(child) && /^(sticky|fixed|absolute)$/.test(getComputedStyle(child).position);
54
55
  var getFirstVisibleElement = function (deltaY) {
55
56
  var children = list.childNodes;
56
57
  var { scrollTop } = list;
57
- deltaY = +deltaY;
58
+ var paddingTop = parseFloat(getComputedStyle(list).paddingTop);
59
+ deltaY = paddingTop + (deltaY || 0);
58
60
  if (deltaY) scrollTop += deltaY;
59
61
  for (var cx = 0, dx = children.length; cx < dx; cx++) {
60
62
  var child = children[cx];
61
- if (!isFinite(child.index) || child.index === null) continue;
63
+ if (!isFinite(child.index) || child.index === null || isSticky(child)) continue;
62
64
  var c = getNodeTarget(child);
63
- if (c.offsetTop + c.offsetHeight > scrollTop) return deltaY === 0 ? child : c;
65
+ if (c.offsetTop + c.offsetHeight >= scrollTop + 1) return deltaY === 0 ? child : c;
64
66
  }
65
67
  return null;
66
68
  };
@@ -101,13 +103,14 @@ function ylist(container, generator, $Y) {
101
103
  var getLastVisibleElement = function (deltaY) {
102
104
  var { scrollTop } = list;
103
105
  deltaY = +deltaY;
106
+ var paddingBottom = parseFloat(getComputedStyle(list).paddingBottom);
104
107
  if (deltaY) scrollTop += deltaY;
105
108
  var children = list.children;
106
109
  for (var cx = children.length - 1; cx >= 0; cx--) {
107
110
  var child = children[cx];
108
- if (!isFinite(child.index)) continue;
111
+ if (!isFinite(child.index) || isSticky(child)) continue;
109
112
  var c = getNodeTarget(child);
110
- if (c.offsetTop < scrollTop + list.clientHeight) {
113
+ if (c.offsetTop + 1 <= scrollTop + list.clientHeight - paddingBottom) {
111
114
  return deltaY === 0 ? child : c;
112
115
  }
113
116
  }
@@ -129,7 +132,7 @@ function ylist(container, generator, $Y) {
129
132
  };
130
133
  var createItem = function (index) {
131
134
  var item = generator(index);
132
- if (item) {
135
+ if (isNode(item)) {
133
136
  item.index = index;
134
137
  }
135
138
  return item;
@@ -137,6 +140,7 @@ function ylist(container, generator, $Y) {
137
140
  //设置当前下标
138
141
  var scrollTo = function (itemIndex) {
139
142
  if (isNaN(itemIndex)) return;
143
+ lastY = NaN;
140
144
  itemIndex = +itemIndex;
141
145
  __animated = false;
142
146
  if (!list.offsetHeight && !list.offsetWidth && !isMounted(list)) {
@@ -334,8 +338,8 @@ function ylist(container, generator, $Y) {
334
338
  item = getNodeTarget(item);
335
339
  scrollTop += flag_element.offsetTop - offsetTop;
336
340
  offsetTop = flag_element.offsetTop;
337
- first_element = item;
338
341
  }
342
+ first_element = item;
339
343
  }
340
344
  //滚动到相应位置
341
345
  if (scrollTop < 0) scrollTop = 0;
@@ -377,15 +381,25 @@ function ylist(container, generator, $Y) {
377
381
  });
378
382
  list.getLastVisibleElement = getLastVisibleElement;
379
383
  list.getFirstVisibleElement = getFirstVisibleElement;
384
+ var lastY = NaN;
385
+ //
386
+ // 最大距离 S,最大初始速度 V = a * t = 1,求加速 a
387
+ // S = 0.5 * a * t * t = 0.5 * V * t;
388
+ // => t = S * 2 / V = S * 2, a = V / t = 1 / (S * 2);
389
+ //
390
+ // 加速度a = 1 / (S * 2),对任意s,有t = sqrt(2 * s / a) = sqrt(2 * s * S * 2) = 2 * sqrt(s * S);
391
+ // 对应速度 v = a * t = 1 / (S * 2) * 2 * sqrt(s * S) = sqrt(s * S) / S;
392
+ // 临近零点的距离 s0 = a / 2 = 1 / (S * 4);
380
393
  list.$stopY = function (t, spd) {
381
394
  var firstElement = getFirstVisibleElement();
382
395
  var lastElement = getLastVisibleElement();
383
396
  if (!firstElement || !lastElement || !list.clientHeight) return false;
384
- var paddingTop = getFirstElement(1).offsetTop;
397
+ if (isNaN(lastY)) return false;
398
+ var paddingTop = parseFloat(getComputedStyle(list).paddingTop);
385
399
  var paddingBottom = parseFloat(getComputedStyle(list).paddingBottom);
386
400
  var scrolled_t = (list.scrollTop - firstElement.offsetTop + paddingTop) / firstElement.offsetHeight;
387
401
  if (scrolled_t > 1) scrolled_t -= scrolled_t | 0;
388
- var last_y = currentY();
402
+ var last_y = lastY;
389
403
  if (spd[0] > 0) {
390
404
  var target_ty = last_y + (1 - scrolled_t) * firstElement.offsetHeight;
391
405
  } else {
@@ -398,17 +412,16 @@ function ylist(container, generator, $Y) {
398
412
  } else {
399
413
  var target_by = last_y - scrolled_b * lastElement.offsetHeight;
400
414
  }
415
+ var S = calcPixel(30);
401
416
  var target_y = Math.abs(target_ty - last_y) > Math.abs(target_by - last_y) ? target_by : target_ty;
402
- var delta = Math.min(calcPixel(30), list.clientHeight >> 2);
417
+ var delta = Math.min(S, list.clientHeight >> 2);
403
418
  var absy = Math.abs(target_y - last_y), y;
404
419
  if (absy >= delta) {
405
420
  return false;
406
421
  }
407
- if (absy <= 1) y = target_y;
422
+ if (absy < 1) y = target_y;
408
423
  else {
409
- var speed = spd.read().rate;
410
- if (speed < 1) speed = 1;
411
- if (absy < 3) speed = .5;
424
+ var speed = Math.sqrt(absy * S) / S;
412
425
  y = last_y + (target_y > last_y ? speed : -speed);
413
426
  }
414
427
  list.$Top(y);
@@ -428,6 +441,7 @@ function ylist(container, generator, $Y) {
428
441
  };
429
442
  list.$Top = function (y) {
430
443
  if (isFinite(y)) {
444
+ lastY = y;
431
445
  var last_y = currentY();
432
446
  if (y !== last_y) {
433
447
  scrollBy(y - last_y);
@@ -625,7 +639,8 @@ function list() {
625
639
  generator = getGeneratorFromArray(container);
626
640
  bindSrc = container;
627
641
  container = div();
628
- } else if (container && !generator) {
642
+ }
643
+ else if (container && !generator) {
629
644
  if (bindSrc) {
630
645
  generator = getGenerator(container);
631
646
  bindSrc = true;
@@ -656,7 +671,7 @@ function list() {
656
671
  appendChild.wrapTarget(container);
657
672
  var list = ($Y === "X" ? xlist : ylist)(container, generator, $Y);
658
673
  if (!list.group) list.group = groupCount || 2;
659
- if (bindSrc instanceof Array) {
674
+ if (bindSrc instanceof Array || isFunction(bindSrc?.next)) {
660
675
  list.src = bindSrc;
661
676
  container.go(container.index() || 0);
662
677
  } else if (bindSrc === true) {
@@ -670,6 +685,10 @@ function list() {
670
685
  if (c.nodeType === 1 && c.$comment && isFinite(c.$comment.index)) return true;
671
686
  return false;
672
687
  });
688
+ if (isFunction(src?.next)) {
689
+ remove(children);
690
+ return;
691
+ }
673
692
  if (src && old) children = Array.prototype.filter.call(children, c => src[c.index] !== old[c.index]);
674
693
  remove(children);
675
694
  };
@@ -6,6 +6,10 @@
6
6
 
7
7
  &.list-x {
8
8
  white-space: nowrap;
9
+
10
+ >* {
11
+ display: inline-block;
12
+ }
9
13
  }
10
14
 
11
15
  >inserty {
@@ -303,11 +303,11 @@ var getOptionsFrom = function () {
303
303
  };
304
304
  function setModel(ipt) {
305
305
  var elem = this;
306
- if (isHandled(ipt) && ipt !== elem) {
306
+ if (isHandled(ipt)) {
307
307
  if (isNode(ipt)) {
308
308
  var model = new Model(getScopeValue, setScopeValue, ipt);
309
309
  model.hook(elem, elem.field.option_to ? copyOptionData : true);
310
- appendChild(elem, ipt);
310
+ if (elem !== ipt) appendChild(elem, ipt);
311
311
  }
312
312
  else {
313
313
  elem.innerText = ipt;
@@ -62,7 +62,6 @@ var addRenderElement = function () {
62
62
  if (!isNode(element)) return;
63
63
  if (element.$renderid !== 9) {
64
64
  // 只渲染一次
65
- if (element.$renderid < 10 && element.$renderid > 0) element.$renderid = ++renderidOffset;
66
65
  renderElements[element.$renderid] = element;
67
66
  }
68
67
  buildFirst(element);
@@ -170,18 +169,10 @@ var createComment = function (renders, type, expression) {
170
169
  };
171
170
 
172
171
  var initialComment = function (comment) {
173
- if (!comment.$struct.once) {
174
- comment.$renderid = ++renderidOffset;
175
- onmounted(comment, addRenderElement);
176
- onremove(comment, removeRenderElement);
177
- if (isMounted(comment) || eagermount) rebuild(comment);
178
- }
179
- else {
172
+ if (comment.$struct.once) {
180
173
  comment.$renderid = 9;
181
- rebuild(comment);
182
- if (comment.with) comment.with = null;
183
- remove(comment);
184
174
  }
175
+ renderlock.push(comment);
185
176
  };
186
177
 
187
178
  class Repeater {
@@ -316,8 +307,7 @@ var createRepeat = function (search, id = 0) {
316
307
  }
317
308
  }
318
309
  }
319
- var clone = element.cloneNode();
320
- clone.innerHTML = element.innerHTML;
310
+ var clone = element.cloneNode(true);
321
311
  clone.$renderid = id;
322
312
  clone.$repeat = clone.$scope = $scope;
323
313
  clone.$parentScopes = $parentScopes;
@@ -347,7 +337,7 @@ var createRepeat = function (search, id = 0) {
347
337
  initialComment(comment);
348
338
  return comment;
349
339
  };
350
- var initIf = function (ifs) {
340
+ var initIfs = function (ifs) {
351
341
  for (var s of ifs) {
352
342
  initialComment(s[0]);
353
343
  }
@@ -505,7 +495,7 @@ var structures = {
505
495
  if (cx < 0) {
506
496
  throw new Error(i18n`else/elseif前缺少同级if!`);
507
497
  }
508
- initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
498
+ if (cx + 1 < if_top.length) initIfs(if_top.splice(cx + 1, if_top.length - cx - 1));
509
499
  var top = if_top[cx];
510
500
  if (search) var getter = createGetter(this, search);
511
501
  var comment = createComment.call(this, undefined, search ? 'elseif' : 'else', search);
@@ -812,7 +802,7 @@ var createEmiter = function (on) {
812
802
  else {
813
803
  onkey = on(key);
814
804
  }
815
- onkey(target, new Emitter(emit, getScopeList(target)));
805
+ onkey(target, new Emitter(emit, getScopeList(this)));
816
806
  };
817
807
  };
818
808
  var emiters = {
@@ -888,12 +878,28 @@ function renderRest(element, struct, replacer = element) {
888
878
  if (!isElement(replacer)) replacer = element;
889
879
  struct.ons.forEach(([on, key, value]) => on.call(element, replacer, key, value));
890
880
  }
891
-
881
+ function renderArray(children, scope, parentScopes, once) {
882
+ if (!children) return;
883
+ if (children.length) {
884
+ var if_top_length = if_top.length;
885
+ for (var cx = 0, dx = children.length; cx < dx; cx++) {
886
+ children[cx] = renderElement(children[cx], scope, parentScopes, once);
887
+ }
888
+ if (if_top_length < if_top.length) {
889
+ initIfs(if_top.splice(if_top_length, if_top.length - if_top_length));
890
+ }
891
+ };
892
+ return children;
893
+ }
894
+ function getChildren(element) {
895
+ var children = element.children;
896
+ if (!children || !children.length) return;
897
+ var children = Array.prototype.filter.call(children, a => !a.$renderid);
898
+ return children
899
+ }
892
900
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
893
901
  if (isArrayLike(element)) {
894
- return Array.apply(null, element).map(function (element) {
895
- return renderElement(element, scope, parentScopes, once);
896
- });
902
+ return renderArray(Array.apply(null, element), scope, parentScopes, once);
897
903
  }
898
904
  if (!isElement(element)) {
899
905
  return element;
@@ -919,7 +925,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
919
925
  element.$scope = scope;
920
926
  if (element.$renderid <= -1) element = renderStructure(element);
921
927
  if (!element) return;
922
- if (!element || element.$renderid < 0 || element.nodeType !== 1) {
928
+ if (element.$renderid < 0 || element.nodeType !== 1) {
923
929
  return element;
924
930
  }
925
931
  var isFirstRender = !element.$renderid;
@@ -954,7 +960,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
954
960
  if (!replacer.$scope) replacer.$scope = scope;
955
961
  if (!replacer.$parentScopes) replacer.$parentScopes = parentScopes;
956
962
  createStructure(replacer);
957
- if (replacer.children && replacer.children.length) renderElement(replacer.children, replacer.$scope, replacer.$parentScopes, once);
963
+ renderArray(getChildren(replacer), replacer.$scope, replacer.$parentScopes, once);
958
964
  renderRest(replacer, replacer.$struct);
959
965
  }
960
966
  copyAttribute(replacer, copys);
@@ -968,9 +974,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
968
974
  }
969
975
  }
970
976
  }
971
- if (!replacer || element === replacer) {
972
- if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
973
- }
977
+ if (!replacer || element === replacer) renderArray(getChildren(element), scope, parentScopes, once);
974
978
  if (isFirstRender) {
975
979
  renderRest(element, $struct, replacer);
976
980
  if (isNode(replacer) && replacer !== element) {
@@ -1229,10 +1233,10 @@ function renderUnlock() {
1229
1233
  renderlock = null;
1230
1234
  locked.forEach(element => {
1231
1235
  if (element.$renderid !== 9) {
1236
+ element.$renderid = ++renderidOffset;
1232
1237
  on("append")(element, addRenderElement);
1233
1238
  onremove(element, removeRenderElement);
1234
- if (isMounted(element));
1235
- else if (element.$renderid > 1) addRenderElement.call(element);
1239
+ if (isMounted(element) || element.nodeType === 8);
1236
1240
  else if (eagermount) buildFirst(element);
1237
1241
  }
1238
1242
  else {
@@ -1257,8 +1261,8 @@ function render(element, scope, parentScopes, lazy = true) {
1257
1261
  var renderonce = lazy === 0;
1258
1262
  if (haslock) eagermount = !+lazy;
1259
1263
  var e = renderElement(element, scope, parentScopes, renderonce);
1264
+ if (if_top_length < if_top.length) initIfs(if_top.splice(if_top_length, if_top.length - if_top_length));
1260
1265
  if (haslock) renderUnlock(element);
1261
- if (if_top_length < if_top.length) initIf(if_top.splice(if_top_length, if_top.length - if_top_length));
1262
1266
  if (haslock) callDigest();
1263
1267
  return e;
1264
1268
  }
@@ -270,9 +270,9 @@ function tree() {
270
270
  var stickys = [];
271
271
  var setSticky = function () {
272
272
  var p = stickys[stickys.length - 1];
273
- var f = banner.getFirstVisibleElement(stickys.top + 1);
273
+ var f = banner.getFirstVisibleElement(stickys.top);
274
274
  if (!f) return;
275
- var limitHeight = f.offsetTop - banner.scrollTop;
275
+ var limitHeight = f.offsetTop - banner.scrollTop - parseFloat(getComputedStyle(banner).paddingTop);
276
276
  var c = dom[f.$index];
277
277
  var useLimit = false;
278
278
  if (p) {
@@ -30,6 +30,7 @@ function ybox(generator) {
30
30
  if (_box.$Height !== _box_Height) _box.$Height = _box_Height;
31
31
  if (_box.$height !== _box_height) _box.$height = _box_height;
32
32
  if (_box.$Top !== _box_Top) _box.$Top = _box_Top;
33
+ _box.parked = true;
33
34
  _box.$scrollY = function (deltay, useIncrease = _box.useIncrease !== false) {
34
35
  var _Top = _box.$Top();
35
36
  var top = _Top + deltay;
@@ -89,14 +90,17 @@ function ybox(generator) {
89
90
  remove(increaser);
90
91
  return 0;
91
92
  };
93
+ scrollY.park = function () {
94
+ _box.parked = true;
95
+ };
92
96
  var stop = _box.$stopY || _box.stopY;
93
97
  var stop2 = lazy(function () {
94
- scrollY.smooth(stop, 4);
98
+ scrollY.smooth(stop);
95
99
  }, 40);
96
100
  var decrease = function (t) {
97
101
  var res = _decrease(increaser_t, t) + _decrease(increaser_b, t);
98
102
  if (!res) {
99
- scrollY.smooth(stop, 4);
103
+ scrollY.smooth(stop);
100
104
  }
101
105
  return true;
102
106
  };
@@ -170,6 +174,7 @@ function ybox(generator) {
170
174
  bindtouch(_box, {
171
175
  start() {
172
176
  scrollY.reset();
177
+ _box.parked = false;
173
178
  },
174
179
  move(scrolled) {
175
180
  var y = -_box.$Top();
@@ -51,7 +51,7 @@ body>& {
51
51
  >.head,
52
52
  >[head] {
53
53
  top: 0;
54
- z-index: 2;
54
+ z-index: 3;
55
55
  background: inherit;
56
56
  position: relative;
57
57
  position: sticky;
@@ -68,9 +68,11 @@ var codecolor = function (c, encode) {
68
68
  }
69
69
  else endi++;
70
70
  var [name] = keys;
71
- if (!o.isprop && o.text !== name && isConstValue(name)) name = wrap(name, "strap");
72
- else name = wrap(name, label);
73
- keys[0] = name;
71
+ if (name && endi > 0) {
72
+ if (!o.isprop && o.text !== name && isConstValue(name)) name = wrap(name, "strap");
73
+ else name = wrap(name, label);
74
+ keys[0] = name;
75
+ }
74
76
  for (var cx = 1, dx = endi; cx < dx; cx++) {
75
77
  var k = keys[cx];
76
78
  keys[cx] = /^[\?]/.test(k) || !k ? k : wrap(k, 'express');
@@ -14,7 +14,6 @@
14
14
  border-top: 42px solid transparent;
15
15
  padding-top: 40px;
16
16
  overflow: auto;
17
- padding-bottom: 0 !important;
18
17
  }
19
18
 
20
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.22.12",
3
+ "version": "4.22.13",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {