|
|
@ -205,16 +205,16 @@ function create_main_fragment(state, component) {
|
|
|
|
|
|
|
|
|
|
|
|
var comments = state.comments;
|
|
|
|
var comments = state.comments;
|
|
|
|
|
|
|
|
|
|
|
|
var each_block_iterations = [];
|
|
|
|
var each_blocks = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
each_block_iterations[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
create: function() {
|
|
|
|
create: function() {
|
|
|
|
for (var i = 0; i < each_block_iterations.length; i += 1) {
|
|
|
|
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
|
|
each_block_iterations[i].create();
|
|
|
|
each_blocks[i].create();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
text = createText("\n\n");
|
|
|
|
text = createText("\n\n");
|
|
|
@ -223,8 +223,8 @@ function create_main_fragment(state, component) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
mount: function(target, anchor) {
|
|
|
|
mount: function(target, anchor) {
|
|
|
|
for (var i = 0; i < each_block_iterations.length; i += 1) {
|
|
|
|
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
|
|
each_block_iterations[i].mount(target, anchor);
|
|
|
|
each_blocks[i].mount(target, anchor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
insertNode(text, target, anchor);
|
|
|
|
insertNode(text, target, anchor);
|
|
|
@ -237,20 +237,20 @@ function create_main_fragment(state, component) {
|
|
|
|
|
|
|
|
|
|
|
|
if (changed.comments || changed.elapsed || changed.time) {
|
|
|
|
if (changed.comments || changed.elapsed || changed.time) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
if (each_block_iterations[i]) {
|
|
|
|
if (each_blocks[i]) {
|
|
|
|
each_block_iterations[i].update(changed, state, comments, comments[i], i);
|
|
|
|
each_blocks[i].update(changed, state, comments, comments[i], i);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
each_block_iterations[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
each_block_iterations[i].create();
|
|
|
|
each_blocks[i].create();
|
|
|
|
each_block_iterations[i].mount(text.parentNode, text);
|
|
|
|
each_blocks[i].mount(text.parentNode, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (; i < each_block_iterations.length; i += 1) {
|
|
|
|
for (; i < each_blocks.length; i += 1) {
|
|
|
|
each_block_iterations[i].unmount();
|
|
|
|
each_blocks[i].unmount();
|
|
|
|
each_block_iterations[i].destroy();
|
|
|
|
each_blocks[i].destroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
each_block_iterations.length = comments.length;
|
|
|
|
each_blocks.length = comments.length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (changed.foo) {
|
|
|
|
if (changed.foo) {
|
|
|
@ -259,8 +259,8 @@ function create_main_fragment(state, component) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
unmount: function() {
|
|
|
|
unmount: function() {
|
|
|
|
for (var i = 0; i < each_block_iterations.length; i += 1) {
|
|
|
|
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
|
|
each_block_iterations[i].unmount();
|
|
|
|
each_blocks[i].unmount();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
detachNode(text);
|
|
|
|
detachNode(text);
|
|
|
@ -268,7 +268,7 @@ function create_main_fragment(state, component) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
destroy: function() {
|
|
|
|
destroy: function() {
|
|
|
|
destroyEach(each_block_iterations, false, 0);
|
|
|
|
destroyEach(each_blocks, false, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|