From fc062980602c79abb201d0b5a547dceec498cf76 Mon Sep 17 00:00:00 2001 From: eavichay Date: Tue, 28 Mar 2017 23:24:20 +0300 Subject: [PATCH] minor fixes --- Slim.js | 6 +-- example/TodoList/Todo2.html | 22 ++++----- example/tests/bind-test.html | 53 ++++++++++++++++++++- example/tests/repeat-benchmark.html | 71 ++++++++++++++++++++++++++--- example/tests/test-repeater.html | 6 ++- 5 files changed, 134 insertions(+), 24 deletions(-) diff --git a/Slim.js b/Slim.js index fb64599..52fe1d9 100644 --- a/Slim.js +++ b/Slim.js @@ -217,7 +217,7 @@ class Slim extends HTMLElement { if (!descriptor.target.hasAttribute('slim-repeat')) { let sourceRef = descriptor.target._boundRepeaterParent || source; let value = sourceRef[ descriptor.method ].apply( sourceRef, - descriptor.properties.map( prop => { return (descriptor.target || sourceRef)[prop] })); + descriptor.properties.map( prop => { return descriptor.target[prop] || sourceRef[prop] })); descriptor.target[ Slim.__dashToCamel(descriptor.attribute) ] = value; descriptor.target.setAttribute( descriptor.attribute, value ) } @@ -661,10 +661,10 @@ Slim.__initRepeater = function() { } Array.prototype.slice.call(clone.querySelectorAll('*')).forEach( element => { element._boundParent = clone._boundParent; - element._boundRepeaterParent = this._boundParent; + element._boundRepeaterParent = clone._boundRepeaterParent; element[targetPropName] = clone[targetPropName]; element.data_index = clone.data_index; - element.data_source = clone.data_source + element.data_source = clone.data_source; }) } diff --git a/example/TodoList/Todo2.html b/example/TodoList/Todo2.html index 252502d..ba091de 100644 --- a/example/TodoList/Todo2.html +++ b/example/TodoList/Todo2.html @@ -25,18 +25,18 @@ + + diff --git a/example/tests/repeat-benchmark.html b/example/tests/repeat-benchmark.html index 3d46cb9..3eb4ce4 100644 --- a/example/tests/repeat-benchmark.html +++ b/example/tests/repeat-benchmark.html @@ -3,33 +3,90 @@ Title + + - +
+ + + +