Skip to content

Commit 2f49ece

Browse files
committed
- dont insert ld-each comment if host provided since we don't need
pivot from comment.
1 parent 93faef7 commit 2f49ece

File tree

9 files changed

+25
-8
lines changed

9 files changed

+25
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Logs
22

3+
## v0.2.6
4+
5+
- dont insert ld-each comment if host provided since we don't need pivot from comment.
6+
7+
38
## v0.2.5
49

510
- support nested local view

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@
161161
nodes: []
162162
};
163163
p = document.createComment(" " + this$.ld + "-each=" + name + " ");
164-
c.insertBefore(p, n);
164+
if (!this$.handler[name].host) {
165+
c.insertBefore(p, n);
166+
}
165167
c.removeChild(n);
166168
p._data = ret;
167169
ret.proxy = p;

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"main": "dist/index.js",
66
"description": "view template micro framework",
7-
"version": "0.2.5",
7+
"version": "0.2.6",
88
"files": [
99
"dist/**/*"
1010
],

src/ldview.ls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ldview.prototype = Object.create(Object.prototype) <<< do
7878
i = Array.from(c.childNodes).indexOf(n)
7979
ret = { idx: i, node: n, name: name, nodes: [] }
8080
p = document.createComment " #{@ld}-each=#{name} "
81-
c.insertBefore p, n
81+
if !@handler[name].host => c.insertBefore p, n
8282
c.removeChild n
8383
p._data = ret
8484
ret.proxy = p

web/static/assets/lib/@loadingio/vscroll/0.0.1/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
opt == null && (opt = {});
66
this.root = opt.root;
77
this.childNodes = Array.from(this.root.childNodes);
8+
console.log(this.childNodes);
89
this.init();
910
return this;
1011
};
1112
vscroll.fixed.prototype = (ref$ = Object.create(Object.prototype), ref$.init = function(){
13+
console.log(this.childNodes.filter(function(n) { return n.nodeType != Node.ELEMENT_NODE}));
1214
var this$ = this;
1315
this.range = [1, 0];
1416
this.row = 1;
@@ -29,6 +31,7 @@
2931
height: 0
3032
};
3133
}, ref$.update = function(){
34+
console.log(">", this.childNodes.filter(function(n) { return n.nodeType != Node.ELEMENT_NODE}));
3235
var ref$, ref1$, i$, to$, i, y, box;
3336
this.rbox = this.root.getBoundingClientRect();
3437
this.row = 0;
@@ -41,9 +44,13 @@
4144
this.root.insertBefore(this.childNodes[i], this.ph[1]);
4245
}
4346
}
47+
console.log(">>", this.childNodes.map(function(n,i) { return [n,i];}).filter(function(n) { return n[0].nodeType != Node.ELEMENT_NODE}));
4448
y = undefined;
49+
console.log(this.childNodes.length);
4550
for (i$ = 0, to$ = this.childNodes.length; i$ < to$; ++i$) {
4651
i = i$;
52+
if(i == 2000) { console.log('here'); }
53+
if(this.childNodes[i].nodeType != Node.ELEMENT_NODE) { console.log(this.childNodes[i], i); }
4754
box = this.childNodes[i].getBoundingClientRect();
4855
this.lineHeight = box.height;
4956
if (!(y != null)) {
@@ -55,6 +62,7 @@
5562
break;
5663
}
5764
}
65+
console.log(">>>", this.childNodes.filter(function(n) { return n.nodeType != Node.ELEMENT_NODE}));
5866
for (i$ = 0, to$ = this.childNodes.length; i$ < to$; ++i$) {
5967
i = i$;
6068
box = this.childNodes[i].getBoundingClientRect();

web/static/assets/lib/ldview/dev/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@
161161
nodes: []
162162
};
163163
p = document.createComment(" " + this$.ld + "-each=" + name + " ");
164-
c.insertBefore(p, n);
164+
if (!this$.handler[name].host) {
165+
c.insertBefore(p, n);
166+
}
165167
c.removeChild(n);
166168
p._data = ret;
167169
ret.proxy = p;

web/static/assets/lib/ldview/dev/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)