efront 4.22.12 → 4.22.14

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
  }
@@ -110,6 +110,7 @@ var wrapTargetMethod = function (target, methodName) {
110
110
  };
111
111
  newMethod.wrapped = true;
112
112
  };
113
+ appendChild.dispatch = _onappend;
113
114
  appendChild.wrapTarget = function (target) {
114
115
  wrapTargetMethod(target, 'insertBefore');
115
116
  wrapTargetMethod(target, 'appendChild');
@@ -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,19 @@ function ylist(container, generator, $Y) {
51
51
  }
52
52
  return null;
53
53
  };
54
+ var isSticky = child => isElement(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
63
  if (!isFinite(child.index) || child.index === null) continue;
62
64
  var c = getNodeTarget(child);
63
- if (c.offsetTop + c.offsetHeight > scrollTop) return deltaY === 0 ? child : c;
65
+ if (isSticky(c)) continue;
66
+ if (c.offsetTop + c.offsetHeight >= scrollTop + 1) return deltaY === 0 ? child : c;
64
67
  }
65
68
  return null;
66
69
  };
@@ -101,13 +104,15 @@ function ylist(container, generator, $Y) {
101
104
  var getLastVisibleElement = function (deltaY) {
102
105
  var { scrollTop } = list;
103
106
  deltaY = +deltaY;
107
+ var paddingBottom = parseFloat(getComputedStyle(list).paddingBottom);
104
108
  if (deltaY) scrollTop += deltaY;
105
109
  var children = list.children;
106
110
  for (var cx = children.length - 1; cx >= 0; cx--) {
107
111
  var child = children[cx];
108
112
  if (!isFinite(child.index)) continue;
109
113
  var c = getNodeTarget(child);
110
- if (c.offsetTop < scrollTop + list.clientHeight) {
114
+ if (isSticky(c)) continue;
115
+ if (c.offsetTop + 1 <= scrollTop + list.clientHeight - paddingBottom) {
111
116
  return deltaY === 0 ? child : c;
112
117
  }
113
118
  }
@@ -129,7 +134,7 @@ function ylist(container, generator, $Y) {
129
134
  };
130
135
  var createItem = function (index) {
131
136
  var item = generator(index);
132
- if (item) {
137
+ if (isNode(item)) {
133
138
  item.index = index;
134
139
  }
135
140
  return item;
@@ -137,6 +142,7 @@ function ylist(container, generator, $Y) {
137
142
  //设置当前下标
138
143
  var scrollTo = function (itemIndex) {
139
144
  if (isNaN(itemIndex)) return;
145
+ lastY = NaN;
140
146
  itemIndex = +itemIndex;
141
147
  __animated = false;
142
148
  if (!list.offsetHeight && !list.offsetWidth && !isMounted(list)) {
@@ -334,8 +340,8 @@ function ylist(container, generator, $Y) {
334
340
  item = getNodeTarget(item);
335
341
  scrollTop += flag_element.offsetTop - offsetTop;
336
342
  offsetTop = flag_element.offsetTop;
337
- first_element = item;
338
343
  }
344
+ first_element = item;
339
345
  }
340
346
  //滚动到相应位置
341
347
  if (scrollTop < 0) scrollTop = 0;
@@ -377,15 +383,25 @@ function ylist(container, generator, $Y) {
377
383
  });
378
384
  list.getLastVisibleElement = getLastVisibleElement;
379
385
  list.getFirstVisibleElement = getFirstVisibleElement;
386
+ var lastY = NaN;
387
+ //
388
+ // 最大距离 S,最大初始速度 V = a * t = 1,求加速 a
389
+ // S = 0.5 * a * t * t = 0.5 * V * t;
390
+ // => t = S * 2 / V = S * 2, a = V / t = 1 / (S * 2);
391
+ //
392
+ // 加速度a = 1 / (S * 2),对任意s,有t = sqrt(2 * s / a) = sqrt(2 * s * S * 2) = 2 * sqrt(s * S);
393
+ // 对应速度 v = a * t = 1 / (S * 2) * 2 * sqrt(s * S) = sqrt(s * S) / S;
394
+ // 临近零点的距离 s0 = a / 2 = 1 / (S * 4);
380
395
  list.$stopY = function (t, spd) {
381
396
  var firstElement = getFirstVisibleElement();
382
397
  var lastElement = getLastVisibleElement();
383
398
  if (!firstElement || !lastElement || !list.clientHeight) return false;
384
- var paddingTop = getFirstElement(1).offsetTop;
399
+ if (isNaN(lastY)) return false;
400
+ var paddingTop = parseFloat(getComputedStyle(list).paddingTop);
385
401
  var paddingBottom = parseFloat(getComputedStyle(list).paddingBottom);
386
402
  var scrolled_t = (list.scrollTop - firstElement.offsetTop + paddingTop) / firstElement.offsetHeight;
387
403
  if (scrolled_t > 1) scrolled_t -= scrolled_t | 0;
388
- var last_y = currentY();
404
+ var last_y = lastY;
389
405
  if (spd[0] > 0) {
390
406
  var target_ty = last_y + (1 - scrolled_t) * firstElement.offsetHeight;
391
407
  } else {
@@ -398,17 +414,16 @@ function ylist(container, generator, $Y) {
398
414
  } else {
399
415
  var target_by = last_y - scrolled_b * lastElement.offsetHeight;
400
416
  }
417
+ var S = calcPixel(30);
401
418
  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);
419
+ var delta = Math.min(S, list.clientHeight >> 2);
403
420
  var absy = Math.abs(target_y - last_y), y;
404
421
  if (absy >= delta) {
405
422
  return false;
406
423
  }
407
- if (absy <= 1) y = target_y;
424
+ if (absy < 1) y = target_y;
408
425
  else {
409
- var speed = spd.read().rate;
410
- if (speed < 1) speed = 1;
411
- if (absy < 3) speed = .5;
426
+ var speed = Math.sqrt(absy * S) / S;
412
427
  y = last_y + (target_y > last_y ? speed : -speed);
413
428
  }
414
429
  list.$Top(y);
@@ -428,6 +443,7 @@ function ylist(container, generator, $Y) {
428
443
  };
429
444
  list.$Top = function (y) {
430
445
  if (isFinite(y)) {
446
+ lastY = y;
431
447
  var last_y = currentY();
432
448
  if (y !== last_y) {
433
449
  scrollBy(y - last_y);
@@ -625,7 +641,8 @@ function list() {
625
641
  generator = getGeneratorFromArray(container);
626
642
  bindSrc = container;
627
643
  container = div();
628
- } else if (container && !generator) {
644
+ }
645
+ else if (container && !generator) {
629
646
  if (bindSrc) {
630
647
  generator = getGenerator(container);
631
648
  bindSrc = true;
@@ -656,7 +673,7 @@ function list() {
656
673
  appendChild.wrapTarget(container);
657
674
  var list = ($Y === "X" ? xlist : ylist)(container, generator, $Y);
658
675
  if (!list.group) list.group = groupCount || 2;
659
- if (bindSrc instanceof Array) {
676
+ if (bindSrc instanceof Array || isFunction(bindSrc?.next)) {
660
677
  list.src = bindSrc;
661
678
  container.go(container.index() || 0);
662
679
  } else if (bindSrc === true) {
@@ -670,6 +687,10 @@ function list() {
670
687
  if (c.nodeType === 1 && c.$comment && isFinite(c.$comment.index)) return true;
671
688
  return false;
672
689
  });
690
+ if (isFunction(src?.next)) {
691
+ remove(children);
692
+ return;
693
+ }
673
694
  if (src && old) children = Array.prototype.filter.call(children, c => src[c.index] !== old[c.index]);
674
695
  remove(children);
675
696
  };
@@ -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;
@@ -60,12 +60,10 @@ var renderidClosed = 0;
60
60
  var addRenderElement = function () {
61
61
  var element = this;
62
62
  if (!isNode(element)) return;
63
- if (element.$renderid !== 9) {
64
- // 只渲染一次
65
- if (element.$renderid < 10 && element.$renderid > 0) element.$renderid = ++renderidOffset;
63
+ buildFirst(element);
64
+ if (element.$renderid > 10) {
66
65
  renderElements[element.$renderid] = element;
67
66
  }
68
- buildFirst(element);
69
67
  };
70
68
  var removeRenderElement = function () {
71
69
  var element = this;
@@ -170,18 +168,10 @@ var createComment = function (renders, type, expression) {
170
168
  };
171
169
 
172
170
  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 {
171
+ if (comment.$struct.once) {
180
172
  comment.$renderid = 9;
181
- rebuild(comment);
182
- if (comment.with) comment.with = null;
183
- remove(comment);
184
173
  }
174
+ renderlock.push(comment);
185
175
  };
186
176
 
187
177
  class Repeater {
@@ -316,8 +306,7 @@ var createRepeat = function (search, id = 0) {
316
306
  }
317
307
  }
318
308
  }
319
- var clone = element.cloneNode();
320
- clone.innerHTML = element.innerHTML;
309
+ var clone = element.cloneNode(true);
321
310
  clone.$renderid = id;
322
311
  clone.$repeat = clone.$scope = $scope;
323
312
  clone.$parentScopes = $parentScopes;
@@ -347,11 +336,6 @@ var createRepeat = function (search, id = 0) {
347
336
  initialComment(comment);
348
337
  return comment;
349
338
  };
350
- var initIf = function (ifs) {
351
- for (var s of ifs) {
352
- initialComment(s[0]);
353
- }
354
- };
355
339
 
356
340
  var ifget = function () {
357
341
  var elements = this.$elements;
@@ -394,6 +378,7 @@ var createIf = function (search, id = 0) {
394
378
  var comment = elements[0] = createComment.call(element, [new Binder2(ifget, ifset)], 'if', search);
395
379
  comment.$id = id;
396
380
  comment.$elements = elements;
381
+ initialComment(comment);
397
382
  return comment;
398
383
  };
399
384
  var parseIfWithRepeat = function (ifExpression, repeatExpression) {
@@ -505,7 +490,7 @@ var structures = {
505
490
  if (cx < 0) {
506
491
  throw new Error(i18n`else/elseif前缺少同级if!`);
507
492
  }
508
- initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
493
+ if (cx + 1 < if_top.length) if_top.splice(cx + 1, if_top.length - cx - 1);
509
494
  var top = if_top[cx];
510
495
  if (search) var getter = createGetter(this, search);
511
496
  var comment = createComment.call(this, undefined, search ? 'elseif' : 'else', search);
@@ -812,7 +797,7 @@ var createEmiter = function (on) {
812
797
  else {
813
798
  onkey = on(key);
814
799
  }
815
- onkey(target, new Emitter(emit, getScopeList(target)));
800
+ onkey(target, new Emitter(emit, getScopeList(this)));
816
801
  };
817
802
  };
818
803
  var emiters = {
@@ -848,7 +833,7 @@ function renderProp(elem, props) {
848
833
  }
849
834
  }
850
835
 
851
- function renderBinds(element, binds, init) {
836
+ function renderBinds(element, binds) {
852
837
  var bind = binders._;
853
838
  for (var k in binds) {
854
839
  if (directives.hasOwnProperty(k)) continue;
@@ -888,12 +873,28 @@ function renderRest(element, struct, replacer = element) {
888
873
  if (!isElement(replacer)) replacer = element;
889
874
  struct.ons.forEach(([on, key, value]) => on.call(element, replacer, key, value));
890
875
  }
891
-
876
+ function renderArray(children, scope, parentScopes, once) {
877
+ if (!children) return;
878
+ if (children.length) {
879
+ var if_top_length = if_top.length;
880
+ for (var cx = 0, dx = children.length; cx < dx; cx++) {
881
+ children[cx] = renderElement(children[cx], scope, parentScopes, once);
882
+ }
883
+ if (if_top_length < if_top.length) {
884
+ if_top.splice(if_top_length, if_top.length - if_top_length);
885
+ }
886
+ };
887
+ return children;
888
+ }
889
+ function getChildren(element) {
890
+ var children = element.children;
891
+ if (!children || !children.length) return;
892
+ var children = Array.prototype.filter.call(children, a => !a.$renderid);
893
+ return children
894
+ }
892
895
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
893
896
  if (isArrayLike(element)) {
894
- return Array.apply(null, element).map(function (element) {
895
- return renderElement(element, scope, parentScopes, once);
896
- });
897
+ return renderArray(Array.apply(null, element), scope, parentScopes, once);
897
898
  }
898
899
  if (!isElement(element)) {
899
900
  return element;
@@ -909,7 +910,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
909
910
  throw new Error(i18n`父作用域链的长度必须相等着`);
910
911
  }
911
912
  }
912
- element.$parentScopes = parentScopes || [];
913
913
  var s = createStructure(element);
914
914
  element.$struct = s;
915
915
  mountElementIds(element, s.ids);
@@ -917,14 +917,16 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
917
917
  element.$eval = $eval;
918
918
  }
919
919
  element.$scope = scope;
920
+ element.$parentScopes = parentScopes || [];
920
921
  if (element.$renderid <= -1) element = renderStructure(element);
921
922
  if (!element) return;
922
- if (!element || element.$renderid < 0 || element.nodeType !== 1) {
923
+ if (element.$renderid < 0 || element.nodeType !== 1) {
923
924
  return element;
924
925
  }
925
926
  var isFirstRender = !element.$renderid;
926
-
927
927
  if (isFirstRender) {
928
+ var lockid = renderlock.length;
929
+ renderlock[lockid] = null;
928
930
  element.$renderid = 1;
929
931
  var parentNode = element.parentNode;
930
932
  if (parentNode) {
@@ -954,7 +956,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
954
956
  if (!replacer.$scope) replacer.$scope = scope;
955
957
  if (!replacer.$parentScopes) replacer.$parentScopes = parentScopes;
956
958
  createStructure(replacer);
957
- if (replacer.children && replacer.children.length) renderElement(replacer.children, replacer.$scope, replacer.$parentScopes, once);
958
959
  renderRest(replacer, replacer.$struct);
959
960
  }
960
961
  copyAttribute(replacer, copys);
@@ -967,11 +968,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
967
968
  }
968
969
  }
969
970
  }
970
- }
971
- if (!replacer || element === replacer) {
972
- if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
973
- }
974
- if (isFirstRender) {
975
971
  renderRest(element, $struct, replacer);
976
972
  if (isNode(replacer) && replacer !== element) {
977
973
  if (!replacer.$renders) replacer.$renders = [];
@@ -980,9 +976,11 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
980
976
  }
981
977
  if (element.$digest || element.$renders.length) {
982
978
  element.$ready = true;
983
- renderlock.push(element);
979
+ renderlock[lockid] = element;
984
980
  }
981
+ else if (renderlock.length === lockid) renderlock.pop();
985
982
  }
983
+ renderArray(getChildren(element), element.$scope || scope, element.$parentScopes || parentScopes, once);
986
984
  return element;
987
985
  }
988
986
  var deepcontexts = [];
@@ -1224,41 +1222,46 @@ function createStructure(element, useExists) {
1224
1222
  element.$eval = $eval;
1225
1223
  return element.$struct = new Struct(ons, types, copys, binds, attr1, props, ids, once);
1226
1224
  }
1227
- function renderUnlock() {
1228
- var locked = renderlock.reverse();
1225
+ function unlock(element) {
1226
+ if (!element) return;
1227
+ if (element.$renderid !== 9) {
1228
+ element.$renderid = ++renderidOffset;
1229
+ on("append")(element, addRenderElement);
1230
+ onremove(element, removeRenderElement);
1231
+ if (element.nodeType === 8);
1232
+ else if (eagermount) buildFirst(element);
1233
+ }
1234
+ else {
1235
+ buildFirst(element);
1236
+ }
1237
+ }
1238
+ function renderUnlock(element) {
1239
+ var locked = renderlock;
1229
1240
  renderlock = null;
1230
- locked.forEach(element => {
1231
- if (element.$renderid !== 9) {
1232
- on("append")(element, addRenderElement);
1233
- onremove(element, removeRenderElement);
1234
- if (isMounted(element));
1235
- else if (element.$renderid > 1) addRenderElement.call(element);
1236
- else if (eagermount) buildFirst(element);
1237
- }
1238
- else {
1239
- buildFirst(element);
1240
- }
1241
- });
1241
+ locked.forEach(unlock);
1242
1242
  eagermount = false;
1243
+ var parentNode = element.parentNode;
1244
+ if (parentNode && isMounted(parentNode)) appendChild.dispatch(element);
1243
1245
  }
1244
- function renderLock() {
1246
+ function renderLock(element) {
1245
1247
  if (!renderlock) {
1246
1248
  renderlock = [];
1249
+ element.$mounted = false;
1247
1250
  return true;
1248
1251
  }
1249
1252
  return false;
1250
1253
  }
1251
1254
  var eagermount = false, renderlock = null;
1252
1255
  function render(element, scope, parentScopes, lazy = true) {
1253
- var haslock = renderLock();
1256
+ var haslock = renderLock(element);
1254
1257
  var if_top_length = if_top.length;
1255
1258
  if (isFinite(scope) && arguments.length === 2) lazy = scope, scope = undefined;
1256
1259
  else if (isFinite(parentScopes) && arguments.length === 3) lazy = parentScopes, parentScopes = undefined;
1257
1260
  var renderonce = lazy === 0;
1258
1261
  if (haslock) eagermount = !+lazy;
1259
1262
  var e = renderElement(element, scope, parentScopes, renderonce);
1263
+ if (if_top_length < if_top.length) if_top.splice(if_top_length, if_top.length - if_top_length);
1260
1264
  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
1265
  if (haslock) callDigest();
1263
1266
  return e;
1264
1267
  }
@@ -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) {