efront 3.21.6 → 3.22.4

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.
Files changed (39) hide show
  1. package/apps/pay/alipay-callback.jsp +8 -5
  2. package/apps/pay/alipay-query.jsp +15 -0
  3. package/apps/pay/alipay.jsp +10 -13
  4. package/apps/pay/alipay_test.js +2 -1
  5. package/apps/pivot/auth/login.html +3 -0
  6. package/apps/pivot/auth/login.js +1 -1
  7. package/apps/pivot/auth/login.less +16 -3
  8. package/apps/pivot/log/boot.js +3 -2
  9. package/coms/basic/BigNumber.js +2 -2
  10. package/coms/basic/BigNumber_test.js +5 -0
  11. package/coms/basic/[]map.js +1 -1
  12. package/coms/compile/scanner2.js +12 -1
  13. package/coms/frame/list.less +6 -4
  14. package/coms/frame/payment.js +17 -2
  15. package/coms/layer/glance.js +4 -2
  16. package/coms/reptile/cross.js +5 -3
  17. package/coms/zimoli/autodragchildren.js +46 -35
  18. package/coms/zimoli/drag.js +1 -1
  19. package/coms/zimoli/gallery.js +1 -1
  20. package/coms/zimoli/getGenerator.js +4 -2
  21. package/coms/zimoli/list.js +31 -22
  22. package/coms/zimoli/menu.js +1 -3
  23. package/coms/zimoli/menuList.js +12 -16
  24. package/coms/zimoli/on.js +12 -0
  25. package/coms/zimoli/once.js +9 -7
  26. package/coms/zimoli/pagination.html +1 -1
  27. package/coms/zimoli/pagination.js +9 -24
  28. package/coms/zimoli/pagination.less +34 -19
  29. package/coms/zimoli/render.js +11 -1
  30. package/coms/zimoli/scrollbar.js +5 -5
  31. package/coms/zimoli/table.html +24 -10
  32. package/coms/zimoli/table.js +270 -61
  33. package/coms/zimoli/table.less +76 -34
  34. package/coms/zimoli/table_test.html +32 -0
  35. package/coms/zimoli/table_test.js +1 -8
  36. package/coms/zimoli/vbox.js +25 -17
  37. package/coms/zimoli/vscroll.js +4 -4
  38. package/package.json +1 -1
  39. package/public/efront.js +1 -1
@@ -5,12 +5,15 @@
5
5
  var id = params.out_trade_no;
6
6
 
7
7
  var data = await _runtask("couchdb", "get", `alipay-log/${id}`);
8
- await _runtask("couchdb", "put", `alipay-log/${id}?_rev=${data._rev}`, extend(data, {
8
+ extend(data, {
9
9
  alipay_trade_no: params.trade_no,
10
10
  seller_id: params.seller_id,
11
11
  return_amount: params.total_amount,
12
- return_time: new Date().toISOString(),
13
- }));
12
+ trade_status: params.trade_status
13
+ });
14
+ if (req.headers["user-agent"]) data.return_time = new Date().toISOString();
15
+ else data.notify_time = new Date().toISOString();
16
+ await _runtask("couchdb", "put", `alipay-log/${id}?_rev=${data._rev}`, data);
14
17
  context.id = params.out_trade_no;
15
18
  </script>
16
19
  <script>
@@ -18,6 +21,6 @@
18
21
  if (id) parent.postMessage(id);
19
22
  </script>
20
23
  <script serverside>
21
- if(context.id)return `<body style="color:green">支付完成</body>`;
24
+ if (context.id) return `<body style="color:green">支付完成</body>`;
22
25
  else return `<body style="color:red">支付失败</body>`
23
- </script>
26
+ </script>
@@ -0,0 +1,15 @@
1
+ <script serverside>
2
+ var time = Date.now();
3
+ var out_trade_no = encode62.timedecode(request.id);
4
+ var payed = /^(TRADE_FINISHED|TRADE_SUCCESS)$/i;
5
+ for (var cx = 0, dx = 10; cx < dx; cx++) {
6
+ if (Date.now() - time > 30000) return;
7
+ var data = await _runtask("couchdb", 'get', `alipay-log/${out_trade_no}`);
8
+ if (data.return_time || data.notify_time || payed.test(data.trade_status)) return JSON.stringify(data);
9
+ var data1 = await _runtask("alipay-query", out_trade_no);
10
+ if (payed.test(data1.trade_status)) {
11
+ return JSON.stringify(Object.assign(data, { trade_status: data1.trade_status }));
12
+ }
13
+ await new Promise(ok => setTimeout(ok, 300));
14
+ }
15
+ </script>
@@ -50,18 +50,13 @@ ACQ.MERCHANT_PERM_RECEIPT_DAY_LIMIT 超过单日累计收款额度 联系支付
50
50
  if (a < 10) return "0" + a;
51
51
  return a;
52
52
  }
53
- var now = new Date();
54
- function createStamp(now) {
55
- var d = now;
56
- return [d.getFullYear(), d.getMonth() + 1, d.getDate()].map(pad).join("-") +
57
- " " + [d.getHours(), d.getMinutes(), d.getSeconds()].map(pad).join(":");
58
- }
59
53
  var amount = request.id;
60
54
  if (!/^(\d+)(\.\d+)?$/.test(amount)) amount = encode62.timedecode(request.id);
61
55
  var [amount, subject = '网页扫码支付'] = amount.split(',');
56
+ var trade_no = createId();
62
57
  if (!+amount) return forbidden("参数异常");
63
58
  var biz_content = {
64
- out_trade_no: "alipay-" + createId(),
59
+ out_trade_no: "alipay-" + trade_no,
65
60
  product_code: 'FAST_INSTANT_TRADE_PAY',
66
61
  total_amount: amount,
67
62
  qr_pay_mode: 4,
@@ -70,7 +65,6 @@ ACQ.MERCHANT_PERM_RECEIPT_DAY_LIMIT 超过单日累计收款额度 联系支付
70
65
  body: subject,
71
66
  };
72
67
  var params = {
73
- timestamp: createStamp(now),
74
68
  method: "alipay.trade.page.pay",
75
69
  app_id: "2021002143612677",
76
70
  sign_type: "RSA2",
@@ -79,6 +73,7 @@ ACQ.MERCHANT_PERM_RECEIPT_DAY_LIMIT 超过单日累计收款额度 联系支付
79
73
  return_url: `${req.protocol}//${req.headers[":authority"] || req.headers.host}${req.url.replace(/[\.\:][\s\S]*$/, '')}-callback`,
80
74
  biz_content: JSON.stringify(biz_content)
81
75
  };
76
+ params.notify_url = params.return_url;
82
77
  await _runtask("alipay-sign", params);
83
78
 
84
79
  var log = await _runtask("couchdb", "put", "alipay-log/" + biz_content.out_trade_no, {
@@ -89,11 +84,13 @@ ACQ.MERCHANT_PERM_RECEIPT_DAY_LIMIT 超过单日累计收款额度 联系支付
89
84
  subject: biz_content.subject,
90
85
  body: biz_content.body,
91
86
  timestamp: params.timestamp,
92
- create_time: now.toISOString(),
87
+ create_time: new Date().toISOString(),
93
88
  return_url: biz_content.return_url
94
89
  });
95
- res.writeHead(302, {
96
- Location: "https://openapi.alipay.com/gateway.do?" + serialize(params)
97
- });
98
- res.end();
90
+ context.id = biz_content.out_trade_no;
91
+ context.location = "https://openapi.alipay.com/gateway.do?" + serialize(params);
92
+ </script>
93
+ <script>
94
+ parent.postMessage(<%JSON.stringify(context.id)%>);
95
+ location.href = <%JSON.stringify(context.location)%>;
99
96
  </script>
@@ -1,13 +1,14 @@
1
1
  var pay = frame$payment([
2
2
  {
3
3
  url: './alipay:',
4
+ query: './alipay-query:',
4
5
  name: '支付宝',
5
6
  icon: 'alipay.ico',
6
7
  cost(price) {
7
8
  return BigNumber.prd((0.6036218 + 0.204081632) / 100, price);
8
9
  },
9
10
  }
10
- ], 1.00, '支付宝支付测试');
11
+ ], 0.01, '支付宝支付测试');
11
12
  popup(pay, true);
12
13
  console.log(pay)
13
14
  care(pay, 'payment', function (a) {
@@ -6,4 +6,7 @@
6
6
  </div>
7
7
  <div foot>
8
8
  <button pending.="pending" type="submit">登录</button>
9
+ </div>
10
+ <div message>
11
+ 登录之前需要使用&nbsp;<b>efront password</b>&nbsp;命令在服务器上设置密码
9
12
  </div>
@@ -9,7 +9,7 @@ function main(host) {
9
9
  page.innerHTML = login;
10
10
  drag.on(page);
11
11
  fields[0].readonly = !!host;
12
- on("append")(page, function () {
12
+ on("mounted")(page, function () {
13
13
  move.bindPosition(page, [.5, .5]);
14
14
  });
15
15
  renderWithDefaults(page, {
@@ -4,11 +4,24 @@
4
4
 
5
5
  [foot],
6
6
  [head] {
7
- &::before{
7
+ &::before {
8
8
  display: none;
9
9
  }
10
+
10
11
  text-align: center;
11
12
  }
12
- .button{
13
- padding: 0px 40px;
13
+
14
+ [message] {
15
+ padding: 2px 4px;
16
+ line-height: 1.2;
17
+ text-align: center;
18
+ color: #29c;
19
+ border-top: 1px solid #29c;
20
+ background: #29c1;
21
+ margin: 0 auto;
22
+ font-size: 12px;
14
23
  }
24
+
25
+ .button {
26
+ padding: 0px 40px;
27
+ }
@@ -5,10 +5,11 @@ var fields = refilm`
5
5
  var ip = e.data[e.field.key];
6
6
  var m = /(\d+\.){3}\d+$/.exec(ip);
7
7
  if (m) {
8
+ var l = document.createElement('label');
9
+ appendChild(e, l);
10
+ l.innerHTML = '&nbsp;';
8
11
  var setAddress = function (a) {
9
- var l = document.createElement('label');
10
12
  l.innerText = a;
11
- appendChild(e, l);
12
13
  };
13
14
  if (e.data.address) setAddress(e.data.address);
14
15
  else e.data.address = data.from("iplocation", { ip: m[0] }, function (a) {
@@ -72,10 +72,10 @@ class BigNumber {
72
72
  return fixde(numstr, 0, 4);
73
73
  }
74
74
  static ceil(numstr) {
75
- return fixde(numstr, 0, 0);
75
+ return fixde(numstr, 0, /^\-/.test(numstr) ? 9 : 0);
76
76
  }
77
77
  static floor(numstr) {
78
- return fixde(numstr, 0, 9);
78
+ return fixde(numstr, 0, /^\-/.test(numstr) ? 0 : 9);
79
79
  }
80
80
  static fix(numstr, fractionDigits) {
81
81
  fractionDigits = +fractionDigits || 0;
@@ -42,11 +42,16 @@ assert(BigNumber.fix(0.00807703432, 2), '0.01');
42
42
  assert(BigNumber.round(2.2349), '2');
43
43
  assert(BigNumber.round(2.4999), '2');
44
44
  assert(BigNumber.round(2.5000), '3');
45
+ assert(BigNumber.round(-2.5000), '-3');
45
46
  assert(BigNumber.round(2.5100), '3');
46
47
  assert(BigNumber.ceil(2.5100), '3');
48
+ assert(BigNumber.ceil(-2.5100), '-2');
47
49
  assert(BigNumber.ceil(2.000), '2');
50
+ assert(BigNumber.ceil(-2.000), '-2');
48
51
  assert(BigNumber.floor(2.000), '2');
52
+ assert(BigNumber.floor(-2.000), '-2');
49
53
  assert(BigNumber.floor(2.999), '2');
54
+ assert(BigNumber.floor(-2.999), '-3');
50
55
  assert(BigNumber.ceil(2.001), '3');
51
56
  assert(BigNumber.ceil(2.999), '3');
52
57
  assert(BigNumber.fix("9007199254740992.234", 6), '9007199254740992.234000');
@@ -78,6 +78,6 @@ if (!function () { }.bind) Function.prototype.bind = function (context) {
78
78
  return function () {
79
79
  var _args = args.slice.call(arguments, 0, arguments.length);
80
80
  args.unshift.apply(_args, args);
81
- return this.apply(context, _args);
81
+ return this.apply(context === void 0 || context === null ? this : context, _args);
82
82
  };
83
83
  };
@@ -287,6 +287,17 @@ class Program extends Array {
287
287
  }
288
288
  }
289
289
 
290
+ var isShortMethodEnd = function (o) {
291
+ if (!o) return false;
292
+ if (o.type !== SCOPED || o.entry !== "{") return false;
293
+ o = o.prev;
294
+ if (!o) return false;
295
+ if (o.type !== SCOPED || o.entry !== "(") return false;
296
+ o = o.prev;
297
+ if (!o) return false;
298
+ return o.type === PROPERTY;
299
+ };
300
+
290
301
  class Javascript {
291
302
  quotes = [
292
303
  [/'/, /'/, /\\[\s\S]/],
@@ -354,7 +365,7 @@ class Javascript {
354
365
  if (queue.isClass) scope.isprop = !last || last.isprop || last.type === STAMP && last.text === ';';
355
366
  }
356
367
  else if (scope.type === STAMP) {
357
- scope.isprop = scope.text === "*" && isProperty();
368
+ scope.isprop = scope.text === "*" && (!queue.lastUncomment || /^[,;]$/.test(queue.lastUncomment.text) || queue.isClass && isShortMethodEnd(queue.lastUncomment));
358
369
  }
359
370
  else if (scope.type === PROPERTY) {
360
371
  scope.isprop = true;
@@ -4,22 +4,24 @@ btn {
4
4
 
5
5
  & {
6
6
  height: 100%;
7
- overflow: auto;
8
7
  }
9
8
 
10
9
  table {
11
10
 
12
11
  td {
13
12
 
14
- >span,
15
- >model {
16
- white-space: normal;
13
+ >[type=text] {
14
+ white-space: pre-wrap;
17
15
  word-break: break-all;
18
16
  overflow: hidden;
19
17
  display: -webkit-box;
20
18
  -webkit-line-clamp: 2;
21
19
  -webkit-box-orient: vertical;
20
+ line-height: 16px;
21
+ font-size: 10px;
22
22
  text-overflow: ellipsis;
23
+ color: #666;
24
+ height: 32px;
23
25
  }
24
26
  }
25
27
  }
@@ -37,9 +37,24 @@ function main(paytypes, price, subject = '网站扫码支付') {
37
37
  drag.on(page.firstChild, page);
38
38
  resize.on(page);
39
39
  var frame = page.querySelector("iframe");
40
+ var tradeid;
40
41
  bind("message")(frame, function (e) {
41
- var id = e.data;
42
- cast(page, 'payment', id);
42
+ if (tradeid === e.data && !queryres) cast(page, 'payment', tradeid), queryres = tradeid;
43
+ else tradeid = e.data, queryres = null;
43
44
  });
45
+ var queryurl, queryres;
46
+ data.bindInstance("paytype", function ({ value }) {
47
+ var type = paytypes[value - 1];
48
+ queryurl = type && type.query;
49
+ });
50
+ var query = lazy(async function () {
51
+ if (!tradeid || queryres) return;
52
+ if (isFunction(queryurl)) var res = await queryurl(tradeid);
53
+ else if (isString(queryurl)) var res = await cross('get', queryurl + encode62.timeencode(tradeid)), res = JSAM.parse(res.response || res.responseText);
54
+ if (queryres) return;
55
+ if (res) queryres = res, cast(page, 'payment', res._id);
56
+ }, -200);
57
+ on('load')(frame, query);
58
+ on('remove')(frame, query);
44
59
  return page;
45
60
  }
@@ -139,10 +139,12 @@ function main(mainPath, historyName = "") {
139
139
  }, 20);
140
140
  }
141
141
  };
142
- on("transitionend")(layer, function (event) {
142
+ var update = function (event) {
143
143
  if (event.target !== this) return;
144
144
  dispatch(window, 'resize');
145
- });
145
+ };
146
+ on("transitionrun")(layer, update);
147
+ on("transitionend")(layer, update);
146
148
  layer.closeLeft = function () {
147
149
  closed = true;
148
150
  bindClass();
@@ -44,14 +44,15 @@ return cross_.bind(function (callback, onerror) {
44
44
  data = Buffer.from(data);
45
45
  this.headers["Content-Length"] = data.length;
46
46
  }
47
- var req = http.request({
47
+ var options = {
48
48
  method: this.method,
49
49
  hostname,
50
50
  port,
51
51
  path,
52
52
  auth,
53
53
  headers: this.headers,
54
- }, function (res) {
54
+ };
55
+ var req = this.http.request(options, function (res) {
55
56
  var data = [];
56
57
  xhr.status = res.statusCode;
57
58
  xhr.responseHeaders = res.headers;
@@ -72,6 +73,7 @@ return cross_.bind(function (callback, onerror) {
72
73
  this.readyState = 2;
73
74
  });
74
75
  this.readyState = 1;
76
+ req.setTimeout(3000);
75
77
  if (data) req.end(data);
76
78
  else req.end();
77
79
  },
@@ -84,7 +86,7 @@ return cross_.bind(function (callback, onerror) {
84
86
  responseObject = null;
85
87
  error = null;
86
88
  var http;
87
- if (/^https?\:/i.test(url)) {
89
+ if (/^http\:/i.test(url)) {
88
90
  http = require("http");
89
91
  }
90
92
  else {
@@ -1,7 +1,6 @@
1
1
  var moveMarginX = function moveMarginX(element, movePixels) {
2
2
  if (element.moved === movePixels) return;
3
3
  element.moved = movePixels;
4
- element.moving = new Date;
5
4
  css(element, {
6
5
  transition: movePixels !== false ? "margin .1s" : '',
7
6
  userSelect: "none",
@@ -21,35 +20,34 @@ var moveChildrenX = function (targetBox, previousElements, followedElements, mov
21
20
  if (area > 0) {
22
21
  var dragPosition = getScreenPosition(dragTarget);
23
22
  var dragPositionLeft = dragPosition.left;
24
- var currentTime = new Date;
25
- previousElements.map(function (element) {
26
- if (currentTime - element.moving < 100) return;
23
+ var dragPositionRight = dragPosition.left + dragPosition.width;
24
+ previousElements.forEach(function (element) {
27
25
  var elementPosition = getScreenPosition(element);
28
26
  var elementCenter = elementPosition.left + elementPosition.width / 2;
29
- if (elementCenter - (element.moved || 0) <= dragPositionLeft) {
27
+ var delta = elementCenter - (element.moved || 0);
28
+ if (delta + 2 <= dragPositionLeft) {
30
29
  recover(element);
31
- } else {
30
+ } else if (delta - 2 >= dragPositionLeft) {
32
31
  moveMargin(element, dragPosition.width);
33
32
  }
34
33
  });
35
- var dragPositionRight = dragPosition.left + dragPosition.width;
36
- followedElements.map(function (element) {
37
- if (currentTime - element.moving < 100) return;
34
+ followedElements.forEach(function (element) {
38
35
  var elementPosition = getScreenPosition(element);
39
36
  var elementCenter = elementPosition.left + elementPosition.width / 2;
40
- if (elementCenter - (element.moved || 0) <= dragPositionRight) {
37
+ var delta = elementCenter - (element.moved || 0);
38
+ if (delta + 2 <= dragPositionRight) {
41
39
  moveMargin(element, -dragPosition.width);
42
- } else {
40
+ } else if (delta - 2 >= dragPositionRight) {
43
41
  recover(element);
44
42
  }
45
43
  });
46
44
  } else {
47
- previousElements.map(recover);
48
- followedElements.map(recover);
45
+ previousElements.forEach(recover);
46
+ followedElements.forEach(recover);
49
47
  }
50
48
  } else {
51
- previousElements.map(recover);
52
- followedElements.map(recover);
49
+ previousElements.forEach(recover);
50
+ followedElements.forEach(recover);
53
51
  }
54
52
  };
55
53
  var scrollX = function (targetBox, moveChildren) {
@@ -86,14 +84,8 @@ var bindTarget = function (index, element) {
86
84
  };
87
85
 
88
86
  var hooka = function (matcher, move, event, targetChild, isMovingSource) {
89
- var dragbox = this.dragbox;
90
- if (dragbox instanceof Function) {
91
- dragbox = dragbox.call(this);
92
- if (dragbox && !getTargetIn(dragbox, event.target)) return;
93
- }
94
- else {
95
- dragbox = this;
96
- }
87
+ var boxfinder;
88
+ if (isMovingSource === false) boxfinder = matcher, matcher = null;
97
89
  var that = this;
98
90
 
99
91
  var draggingSourceOpacity = isMovingSource !== false ? 0 : 1;
@@ -102,7 +94,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
102
94
  moveMargin(element, 0);
103
95
  };
104
96
  var cloneCell = function (element) {
105
- var targets = getTargetIn(matcher, element, false);
97
+ var targets = matcher ? getTargetIn(matcher, element, false) : element;
106
98
  if (isArray(targets)) {
107
99
  var extra = targets.slice(1);
108
100
  targets = cloneVisible(targets[0]);
@@ -131,6 +123,19 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
131
123
  }
132
124
  return targets;
133
125
  };
126
+ var getBoundingClientRect = function () { return getScreenPosition(this.target) }
127
+ var bindExtra = function (element) {
128
+ if (!matcher) return element;
129
+ var targets = getTargetIn(matcher, element, false);
130
+ if (isArray(targets)) {
131
+ var [target] = targets;
132
+ return {
133
+ style: target.style, target, getBoundingClientRect,
134
+ with: targets
135
+ };
136
+ }
137
+ return targets;
138
+ };
134
139
  if (event.target === this) return;
135
140
  // var targetChild = getTargetIn(matcher, event.target);
136
141
  if (!targetChild) return;
@@ -140,11 +145,10 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
140
145
  }
141
146
  var targetBox, saved_opacity, saved_filter, moveMargin, moveChildren;
142
147
  var previousElements, followedElements, rebuildTargets, scroll;
143
- var that = this;
144
148
  var draginit = function () {
145
149
  that.setAttribute('dragchildren', '');
146
150
  if (targetBox) addClass(targetBox, 'dropping');
147
- if (getTargetIn(dragbox, targetChild)) {
151
+ if (isMovingSource !== false) {
148
152
  targetBox = targetChild.parentNode;
149
153
  previousElements = getPreviousElementSiblings(targetChild);
150
154
  followedElements = getFollowedElementSiblings(targetChild);
@@ -158,7 +162,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
158
162
  followedElements = [];
159
163
  moveChildren = () => { };
160
164
  rebuildTargets = function () {
161
- var temp = matcher(drag.target);
165
+ var temp = boxfinder(drag.target);
162
166
  if (temp === targetBox) return;
163
167
  if (previousElements) previousElements.map(recover);
164
168
  if (followedElements) followedElements.map(recover);
@@ -176,11 +180,12 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
176
180
  previousElements = [].slice.call(targetBox.children, 0).reverse();
177
181
  followedElements = [];
178
182
  [moveMargin, moveChildren, scroll] = getMoveFuncs(previousElements[0]);
179
- moveChildren = moveChildren.bind(null, that, previousElements, followedElements, moveMargin, recover);
183
+ moveChildren = moveChildren.bind(null, targetBox, previousElements, followedElements, moveMargin, recover);
180
184
  };
181
185
  }
182
186
  };
183
187
  var dragfire = function () {
188
+ if (!targetBox) return;
184
189
  that.removeAttribute('dragchildren');
185
190
  removeClass(targetBox, "dropping");
186
191
  var dst, appendSibling, delta;
@@ -241,10 +246,10 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
241
246
  clearInterval(autoScroll.ing);
242
247
  autoScroll.ing = 0;
243
248
  };
244
- var dragmove = function (event) {
249
+ var dragmove = lazy(function (event) {
245
250
  rebuildTargets();
246
251
  moveChildren.call(this, event);
247
- };
252
+ }, -100);
248
253
 
249
254
  // 修改margin无效的情况
250
255
  function dragclone() {
@@ -278,6 +283,12 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
278
283
  function draglist() {
279
284
  draginit();
280
285
  rebuildTargets();
286
+ var _previousElements = previousElements.map(bindExtra);
287
+ var _followedElements = followedElements.map(bindExtra);
288
+ previousElements.splice(0, previousElements.length);
289
+ followedElements.splice(0, followedElements.length);
290
+ previousElements.push.apply(previousElements, _previousElements);
291
+ followedElements.push.apply(followedElements, _followedElements);
281
292
  autoScroll();
282
293
  var offall = function () {
283
294
  cancelScroll();
@@ -287,8 +298,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
287
298
  var offdragend = on("dragend")(targetChild, function () {
288
299
  offall();
289
300
  dragfire();
290
- previousElements.map(e => moveMargin(e, false));
291
- followedElements.map(e => moveMargin(e, false));
301
+ previousElements.forEach(e => moveMargin(e, false));
302
+ followedElements.forEach(e => moveMargin(e, false));
292
303
  });
293
304
  var offdragmove = on("dragmove")(targetChild, dragmove);
294
305
  }
@@ -305,7 +316,7 @@ var hookEvent = function (matcher, move, event) {
305
316
  hooka.call(this, matcher, move, event, targetChild);
306
317
  };
307
318
  function addhook() {
308
- var mousedownEvent, targetElement, callback, matcher, dropid, allowdrops;
319
+ var mousedownEvent, targetElement, callback, boxfinder, dropid, allowdrops;
309
320
  [].forEach.call(arguments, function (arg) {
310
321
  switch (typeof arg) {
311
322
  case "string":
@@ -315,7 +326,7 @@ function addhook() {
315
326
  if (!callback) {
316
327
  callback = arg;
317
328
  } else {
318
- matcher = callback;
329
+ boxfinder = callback;
319
330
  callback = arg;
320
331
  }
321
332
  break;
@@ -338,7 +349,7 @@ function addhook() {
338
349
  if (!mousedownEvent) return;
339
350
  var target = targetElement || mousedownEvent.currentTarget;
340
351
  hooka.call(targetElement, function (target) {
341
- var res = [].filter.call(allowdrops || (matcher ? matcher(target) : document.querySelectorAll("[allowdrop]")), function (child) {
352
+ var res = Array.prototype.filter.call(allowdrops || (boxfinder ? boxfinder(target) : document.querySelectorAll("[allowdrop]")), function (child) {
342
353
  return target && overlap(child, target);
343
354
  }).filter(e => {
344
355
  var a = e.getAttribute("allowdrop");
@@ -33,7 +33,7 @@ var setZIndex = function () {
33
33
  }
34
34
  };
35
35
  function drag(target, initialEvent, preventOverflow, isMovingSource) {
36
- if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName) || getTargetIn(a => a.nodrag || a.hasAttribute('nodrag') || a.dragable === false, initialEvent.target)) return;
36
+ if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName) || getTargetIn(a => a.nodrag || a.hasAttribute('nodrag'), initialEvent.target)) return;
37
37
  if (target.dragable === false) return;
38
38
  initialEvent.preventDefault();
39
39
  if (isArray(target)) {
@@ -55,7 +55,7 @@ function gallery(element, minWidth, generator) {
55
55
  var e = generator(realindex);
56
56
  return e;
57
57
  });
58
- _box.stopY = noop;
58
+ _box.$stopY = noop;
59
59
  _box.delta = id;
60
60
  setWidth(_box);
61
61
  return _box;
@@ -2,6 +2,9 @@
2
2
  var _slider = createElement(div);
3
3
  var getGenerator = function (container, tagName = 'item') {
4
4
  if (!container) return;
5
+ var scopes = container.$parentScopes || [];
6
+ if (container.$scope) scopes = scopes.concat(container.$scope);
7
+ container.$generatorScopes = scopes;
5
8
  if (container.$generator) return container.$generator;
6
9
  var template = document.createElement(tagName);
7
10
  var templates = [].concat.apply([], container.childNodes).filter(a => {
@@ -21,8 +24,6 @@ var getGenerator = function (container, tagName = 'item') {
21
24
  appendChild(template, templates);
22
25
  container.insertBefore = _slider.insertBefore;
23
26
  container.appendChild = _slider.appendChild;
24
- var scopes = container.$parentScopes || [];
25
- if (container.$scope) scopes = scopes.concat(container.$scope);
26
27
  return container.$generator = function (index, com, element) {
27
28
  if (com === undefined) {
28
29
  if (!container.src || index >= container.src.length) return;
@@ -39,6 +40,7 @@ var getGenerator = function (container, tagName = 'item') {
39
40
  if (template1.childNodes.length > 1) element.with = [].concat.apply([], template1.childNodes).slice(1);
40
41
  }
41
42
  }
43
+ var scopes = container.$generatorScopes;
42
44
  var parsedSrc = container.$src;
43
45
  if (parsedSrc) {
44
46
  var { keyName, itemName, indexName } = parsedSrc;