Skip to content

Commit

Permalink
chore(all): prepare release 0.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 6, 2015
1 parent 1180971 commit 85f4dd4
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-resources",
"version": "0.8.6",
"version": "0.8.7",
"description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.",
"keywords": [
"aurelia",
Expand Down
23 changes: 20 additions & 3 deletions dist/amd/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ define(["exports", "aurelia-binding", "aurelia-templating"], function (exports,

this.executionContext = executionContext;

if (!items) {
if (this.oldItems) {
this.viewSlot.removeAll();
}

return;
}

if (this.oldItems === items) {
var splices = calcSplices(items, 0, items.length, this.lastBoundItems, 0, this.lastBoundItems.length);
var observer = this.observerLocator.getArrayObserver(items);
Expand All @@ -59,7 +67,10 @@ define(["exports", "aurelia-binding", "aurelia-templating"], function (exports,
unbind: {
value: function unbind() {
this.oldItems = this.items;
this.lastBoundItems = this.items.slice(0);

if (this.items) {
this.lastBoundItems = this.items.slice(0);
}

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
Expand All @@ -80,19 +91,25 @@ define(["exports", "aurelia-binding", "aurelia-templating"], function (exports,
value: function processItems() {
var _this = this;
var items = this.items,
observer = this.observerLocator.getArrayObserver(items),
viewSlot = this.viewSlot,
viewFactory = this.viewFactory,
i,
ii,
row,
view;
view,
observer;

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
viewSlot.removeAll();
}

if (!items) {
return;
}

observer = this.observerLocator.getArrayObserver(items);

for (i = 0, ii = items.length; i < ii; ++i) {
row = this.createFullExecutionContext(items[i], i, ii);
view = viewFactory.create(row);
Expand Down
23 changes: 20 additions & 3 deletions dist/commonjs/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ var Repeat = exports.Repeat = (function () {

this.executionContext = executionContext;

if (!items) {
if (this.oldItems) {
this.viewSlot.removeAll();
}

return;
}

if (this.oldItems === items) {
var splices = calcSplices(items, 0, items.length, this.lastBoundItems, 0, this.lastBoundItems.length);
var observer = this.observerLocator.getArrayObserver(items);
Expand All @@ -62,7 +70,10 @@ var Repeat = exports.Repeat = (function () {
unbind: {
value: function unbind() {
this.oldItems = this.items;
this.lastBoundItems = this.items.slice(0);

if (this.items) {
this.lastBoundItems = this.items.slice(0);
}

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
Expand All @@ -83,19 +94,25 @@ var Repeat = exports.Repeat = (function () {
value: function processItems() {
var _this = this;
var items = this.items,
observer = this.observerLocator.getArrayObserver(items),
viewSlot = this.viewSlot,
viewFactory = this.viewFactory,
i,
ii,
row,
view;
view,
observer;

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
viewSlot.removeAll();
}

if (!items) {
return;
}

observer = this.observerLocator.getArrayObserver(items);

for (i = 0, ii = items.length; i < ii; ++i) {
row = this.createFullExecutionContext(items[i], i, ii);
view = viewFactory.create(row);
Expand Down
32 changes: 24 additions & 8 deletions dist/es6/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ export class Repeat {

this.executionContext = executionContext;

if(!items){
if(this.oldItems){
this.viewSlot.removeAll();
}

return;
}

if(this.oldItems === items){
var splices = calcSplices(items, 0, items.length, this.lastBoundItems, 0, this.lastBoundItems.length);
var observer = this.observerLocator.getArrayObserver(items);

this.handleSplices(items, splices);
this.lastBoundItems = this.oldItems = null;

this.disposeArraySubscription = observer.subscribe(splices => {
this.handleSplices(items, splices);
});
Expand All @@ -39,7 +47,10 @@ export class Repeat {

unbind(){
this.oldItems = this.items;
this.lastBoundItems = this.items.slice(0);

if(this.items){
this.lastBoundItems = this.items.slice(0);
}

if(this.disposeArraySubscription){
this.disposeArraySubscription();
Expand All @@ -53,16 +64,21 @@ export class Repeat {

processItems(){
var items = this.items,
observer = this.observerLocator.getArrayObserver(items),
viewSlot = this.viewSlot,
viewFactory = this.viewFactory,
i, ii, row, view;
i, ii, row, view, observer;

if(this.disposeArraySubscription){
if (this.disposeArraySubscription) {
this.disposeArraySubscription();
viewSlot.removeAll();
}

if(!items){
return;
}

observer = this.observerLocator.getArrayObserver(items);

for(i = 0, ii = items.length; i < ii; ++i){
row = this.createFullExecutionContext(items[i], i, ii);
view = viewFactory.create(row);
Expand All @@ -89,7 +105,7 @@ export class Repeat {
var first = (index === 0),
last = (index === length - 1),
even = index % 2 === 0;

context.$parent = this.executionContext;
context.$index = index;
context.$first = first;
Expand Down Expand Up @@ -119,7 +135,7 @@ export class Repeat {
for (j = 0, jj = removed.length; j < jj; ++j) {
model = removed[j];
view = viewSlot.removeAt(splice.index + removeDelta);

if (view) {
viewLookup.set(model, view);
}
Expand Down Expand Up @@ -157,4 +173,4 @@ export class Repeat {

viewLookup.forEach(x => x.unbind());
}
}
}
23 changes: 20 additions & 3 deletions dist/system/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ System.register(["aurelia-binding", "aurelia-templating"], function (_export) {

this.executionContext = executionContext;

if (!items) {
if (this.oldItems) {
this.viewSlot.removeAll();
}

return;
}

if (this.oldItems === items) {
var splices = calcSplices(items, 0, items.length, this.lastBoundItems, 0, this.lastBoundItems.length);
var observer = this.observerLocator.getArrayObserver(items);
Expand All @@ -65,7 +73,10 @@ System.register(["aurelia-binding", "aurelia-templating"], function (_export) {
unbind: {
value: function unbind() {
this.oldItems = this.items;
this.lastBoundItems = this.items.slice(0);

if (this.items) {
this.lastBoundItems = this.items.slice(0);
}

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
Expand All @@ -86,19 +97,25 @@ System.register(["aurelia-binding", "aurelia-templating"], function (_export) {
value: function processItems() {
var _this = this;
var items = this.items,
observer = this.observerLocator.getArrayObserver(items),
viewSlot = this.viewSlot,
viewFactory = this.viewFactory,
i,
ii,
row,
view;
view,
observer;

if (this.disposeArraySubscription) {
this.disposeArraySubscription();
viewSlot.removeAll();
}

if (!items) {
return;
}

observer = this.observerLocator.getArrayObserver(items);

for (i = 0, ii = items.length; i < ii; ++i) {
row = this.createFullExecutionContext(items[i], i, ii);
view = viewFactory.create(row);
Expand Down
8 changes: 8 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 0.8.7 (2015-02-06)


#### Bug Fixes

* **repeat:** error when items are undefined ([11809714](http://github.com/aurelia/templating-resources/commit/118097145e3d7a936280f9110c44b6724ed51ba2))


### 0.8.6 (2015-02-06)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-resources",
"version": "0.8.6",
"version": "0.8.7",
"description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 85f4dd4

Please sign in to comment.