Skip to content

Commit

Permalink
chore(all): prepare release 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Oct 24, 2017
1 parent 31798f5 commit b8cba60
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 38 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": "1.5.2",
"version": "1.5.3",
"description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.",
"keywords": [
"aurelia",
Expand Down
12 changes: 10 additions & 2 deletions dist/amd/else.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c
return _this;
}

Else.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
};

Else.prototype._registerInIf = function _registerInIf() {
var previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -54,8 +62,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
var ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
};

return Else;
Expand Down
8 changes: 5 additions & 3 deletions dist/amd/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c

If.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
};

If.prototype.conditionChanged = function conditionChanged(newValue) {
Expand All @@ -109,8 +111,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c
}

var promise = void 0;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
1 change: 1 addition & 0 deletions dist/aurelia-templating-resources.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ export declare class SetRepeatStrategy {
}
export declare class Else extends IfCore {
constructor(viewFactory?: any, viewSlot?: any);
bind(bindingContext?: any, overrideContext?: any): any;
}

/**
Expand Down
20 changes: 15 additions & 5 deletions dist/aurelia-templating-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,14 @@ export class Else extends IfCore {
this._registerInIf();
}

bind(bindingContext, overrideContext) {
super.bind(bindingContext, overrideContext);
// Render on initial
if (!this.ifVm.condition) {
this._show();
}
}

_registerInIf() {
// We support the pattern <div if.bind="x"></div><div else></div>.
// Obvisouly between the two, we must accepts text (spaces) and comments.
Expand All @@ -1686,8 +1694,8 @@ export class Else extends IfCore {
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
let ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
}
}

Expand All @@ -1709,7 +1717,9 @@ export class If extends IfCore {
*/
bind(bindingContext, overrideContext) {
super.bind(bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
}

/**
Expand All @@ -1726,8 +1736,8 @@ export class If extends IfCore {
}

let promise;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
12 changes: 10 additions & 2 deletions dist/commonjs/else.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ var Else = exports.Else = (_dec = (0, _aureliaTemplating.customAttribute)('else'
return _this;
}

Else.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
};

Else.prototype._registerInIf = function _registerInIf() {
var previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -39,8 +47,8 @@ var Else = exports.Else = (_dec = (0, _aureliaTemplating.customAttribute)('else'
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
var ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
};

return Else;
Expand Down
8 changes: 5 additions & 3 deletions dist/commonjs/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ var If = exports.If = (_dec = (0, _aureliaTemplating.customAttribute)('if'), _de

If.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
};

If.prototype.conditionChanged = function conditionChanged(newValue) {
Expand All @@ -94,8 +96,8 @@ var If = exports.If = (_dec = (0, _aureliaTemplating.customAttribute)('if'), _de
}

var promise = void 0;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
12 changes: 10 additions & 2 deletions dist/es2015/else.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export let Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto
this._registerInIf();
}

bind(bindingContext, overrideContext) {
super.bind(bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
}

_registerInIf() {
let previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -18,7 +26,7 @@ export let Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
let ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
}
}) || _class) || _class) || _class);
8 changes: 5 additions & 3 deletions dist/es2015/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export let If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory,

bind(bindingContext, overrideContext) {
super.bind(bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
}

conditionChanged(newValue) {
Expand All @@ -69,8 +71,8 @@ export let If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory,
}

let promise;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
12 changes: 10 additions & 2 deletions dist/native-modules/else.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ export var Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto
return _this;
}

Else.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
};

Else.prototype._registerInIf = function _registerInIf() {
var previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -30,8 +38,8 @@ export var Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
var ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
};

return Else;
Expand Down
8 changes: 5 additions & 3 deletions dist/native-modules/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export var If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory,

If.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
};

If.prototype.conditionChanged = function conditionChanged(newValue) {
Expand All @@ -85,8 +87,8 @@ export var If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory,
}

var promise = void 0;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
12 changes: 10 additions & 2 deletions dist/system/else.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor
return _this;
}

Else.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
};

Else.prototype._registerInIf = function _registerInIf() {
var previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -63,8 +71,8 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
var ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
};

return Else;
Expand Down
8 changes: 5 additions & 3 deletions dist/system/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor

If.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
};

If.prototype.conditionChanged = function conditionChanged(newValue) {
Expand All @@ -119,8 +121,8 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor
}

var promise = void 0;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
20 changes: 15 additions & 5 deletions dist/temp/aurelia-templating-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,14 @@ var Else = exports.Else = (_dec15 = (0, _aureliaTemplating.customAttribute)('els
return _this13;
}

Else.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore.prototype.bind.call(this, bindingContext, overrideContext);

if (!this.ifVm.condition) {
this._show();
}
};

Else.prototype._registerInIf = function _registerInIf() {
var previous = this.viewSlot.anchor.previousSibling;
while (previous && !previous.au) {
Expand All @@ -1558,8 +1566,8 @@ var Else = exports.Else = (_dec15 = (0, _aureliaTemplating.customAttribute)('els
if (!previous || !previous.au.if) {
throw new Error("Can't find matching If for Else custom attribute.");
}
var ifVm = previous.au.if.viewModel;
ifVm.else = this;
this.ifVm = previous.au.if.viewModel;
this.ifVm.elseVm = this;
};

return Else;
Expand All @@ -1581,7 +1589,9 @@ var If = exports.If = (_dec17 = (0, _aureliaTemplating.customAttribute)('if'), _

If.prototype.bind = function bind(bindingContext, overrideContext) {
_IfCore2.prototype.bind.call(this, bindingContext, overrideContext);
this.conditionChanged(this.condition);
if (this.condition) {
this._show();
}
};

If.prototype.conditionChanged = function conditionChanged(newValue) {
Expand All @@ -1596,8 +1606,8 @@ var If = exports.If = (_dec17 = (0, _aureliaTemplating.customAttribute)('if'), _
}

var promise = void 0;
if (this.else) {
promise = show ? this._swap(this.else, this) : this._swap(this, this.else);
if (this.elseVm) {
promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);
} else {
promise = show ? this._show() : this._hide();
}
Expand Down
13 changes: 13 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<a name="1.5.3"></a>
## [1.5.3](https://github.com/aurelia/templating-resources/compare/1.5.2...1.5.3) (2017-10-24)


### Bug Fixes

* **if-else:** Fixed missing binding context when rendering else block ([e55fdf9](https://github.com/aurelia/templating-resources/commit/e55fdf9))
* **if-else:** Fixed typo and removed obsolete error ([18a4e7e](https://github.com/aurelia/templating-resources/commit/18a4e7e))
* **if-else:** Removed fit in tests ([39fb831](https://github.com/aurelia/templating-resources/commit/39fb831))
* **if-else:** Simplified initial condition check ([2103aca](https://github.com/aurelia/templating-resources/commit/2103aca))



<a name="1.5.2"></a>
## [1.5.2](https://github.com/aurelia/templating-resources/compare/1.5.1...1.5.2) (2017-10-23)

Expand Down
2 changes: 1 addition & 1 deletion doc/api.json

Large diffs are not rendered by default.

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": "1.5.2",
"version": "1.5.3",
"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 b8cba60

Please sign in to comment.