|
41 | 41 | this.root.textContent = ''; |
42 | 42 | this.root.appendChild(this.template.cloneNode(true)); |
43 | 43 | } |
44 | | - if (typeof this._ctx === 'function') { |
45 | | - this._ctx = this._ctx({ |
46 | | - node: this.root, |
47 | | - ctxs: this._ctxs, |
48 | | - views: this.views |
49 | | - }); |
50 | | - } |
51 | 44 | this.update(); |
52 | 45 | names = {}; |
53 | 46 | for (i$ = 0, len$ = (ref$ = [(fn$.call(this))].concat([(fn1$.call(this))], [(fn2$.call(this))], [(fn3$.call(this))], [(fn4$.call(this))], (fn5$.call(this)).map(fn6$))).length; i$ < len$; ++i$) { |
|
232 | 225 | } |
233 | 226 | }, |
234 | 227 | procEach: function(name, data, key, initOnly){ |
235 | | - var list, getkey, hash, items, nodes, proxyIndex, ns, i$, i, n, j, node, idx, expectedIdx, _, ps, this$ = this; |
| 228 | + var c, list, getkey, hash, items, nodes, proxyIndex, ns, i$, i, n, j, node, idx, expectedIdx, _, ps, this$ = this; |
236 | 229 | key == null && (key = null); |
| 230 | + c = typeof this._ctx === 'function' |
| 231 | + ? this._ctx({ |
| 232 | + node: this.root, |
| 233 | + ctxs: this._ctxs, |
| 234 | + views: this.views |
| 235 | + }) |
| 236 | + : this._ctx; |
237 | 237 | list = this.handler[name].list({ |
238 | 238 | name: data.name, |
239 | 239 | node: data.node, |
240 | 240 | views: this.views, |
241 | | - context: this._ctx, |
242 | | - ctx: this._ctx, |
| 241 | + context: c, |
| 242 | + ctx: c, |
243 | 243 | ctxs: this._ctxs |
244 | 244 | }) || []; |
245 | 245 | getkey = this.handler[name].key; |
|
345 | 345 | }); |
346 | 346 | }, |
347 | 347 | _render: function(n, d, i, b, e, initOnly){ |
348 | | - var init, handler, text, attr, style, action, ref$, k, v, f, results$ = []; |
349 | | - d.ctx = this._ctx; |
350 | | - d.context = this._ctx; |
| 348 | + var c, init, handler, text, attr, style, action, ref$, k, v, f, results$ = []; |
| 349 | + c = typeof this._ctx === 'function' |
| 350 | + ? c = this._ctx({ |
| 351 | + node: this.root, |
| 352 | + ctxs: this._ctxs, |
| 353 | + views: this.views |
| 354 | + }) |
| 355 | + : this._ctx; |
| 356 | + d.ctx = c; |
| 357 | + d.context = c; |
351 | 358 | d.ctxs = this._ctxs; |
352 | 359 | d.views = this.views; |
353 | 360 | if (b) { |
|
0 commit comments