From 30096a81c1fe057ba28b41b639459eb554d342b5 Mon Sep 17 00:00:00 2001 From: EisenbergEffect Date: Fri, 27 Oct 2017 16:47:48 -0700 Subject: [PATCH] chore(all): prepare release 1.5.4 --- bower.json | 2 +- dist/amd/else.js | 4 +++- dist/amd/if-core.js | 4 +++- dist/amd/if.js | 2 ++ dist/aurelia-templating-resources.js | 13 +++++++++++-- dist/commonjs/else.js | 4 +++- dist/commonjs/if-core.js | 4 +++- dist/commonjs/if.js | 2 ++ dist/es2015/else.js | 4 +++- dist/es2015/if-core.js | 4 +++- dist/es2015/if.js | 2 ++ dist/native-modules/else.js | 4 +++- dist/native-modules/if-core.js | 4 +++- dist/native-modules/if.js | 2 ++ dist/system/else.js | 4 +++- dist/system/if-core.js | 4 +++- dist/system/if.js | 2 ++ dist/temp/aurelia-templating-resources.js | 10 ++++++++-- doc/CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 20 files changed, 71 insertions(+), 16 deletions(-) diff --git a/bower.json b/bower.json index 0c1eea0..e498082 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating-resources", - "version": "1.5.3", + "version": "1.5.4", "description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.", "keywords": [ "aurelia", diff --git a/dist/amd/else.js b/dist/amd/else.js index 75732da..d153ba6 100644 --- a/dist/amd/else.js +++ b/dist/amd/else.js @@ -49,7 +49,9 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c Else.prototype.bind = function bind(bindingContext, overrideContext) { _IfCore.prototype.bind.call(this, bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } }; diff --git a/dist/amd/if-core.js b/dist/amd/if-core.js index db5c683..94ddd11 100644 --- a/dist/amd/if-core.js +++ b/dist/amd/if-core.js @@ -33,7 +33,6 @@ define(["exports"], function (exports) { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -49,6 +48,9 @@ define(["exports"], function (exports) { IfCore.prototype._show = function _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } diff --git a/dist/amd/if.js b/dist/amd/if.js index f1a420b..0ed7095 100644 --- a/dist/amd/if.js +++ b/dist/amd/if.js @@ -96,6 +96,8 @@ define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', './if-c _IfCore.prototype.bind.call(this, bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } }; diff --git a/dist/aurelia-templating-resources.js b/dist/aurelia-templating-resources.js index 90636f2..b66c126 100644 --- a/dist/aurelia-templating-resources.js +++ b/dist/aurelia-templating-resources.js @@ -396,7 +396,6 @@ export class IfCore { // For example a view could be returned to the cache and reused while it's still // attached to the DOM and animated. if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -412,6 +411,12 @@ export class IfCore { _show() { if (this.showing) { + // Ensures the view is bound. + // It might not be the case when the if was unbound but not detached, then rebound. + // Typical case where this happens is nested ifs + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } @@ -1676,7 +1681,9 @@ export class Else extends IfCore { bind(bindingContext, overrideContext) { super.bind(bindingContext, overrideContext); // Render on initial - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } } @@ -1719,6 +1726,8 @@ export class If extends IfCore { super.bind(bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } } diff --git a/dist/commonjs/else.js b/dist/commonjs/else.js index da3b5c3..22daeed 100644 --- a/dist/commonjs/else.js +++ b/dist/commonjs/else.js @@ -34,7 +34,9 @@ var Else = exports.Else = (_dec = (0, _aureliaTemplating.customAttribute)('else' Else.prototype.bind = function bind(bindingContext, overrideContext) { _IfCore.prototype.bind.call(this, bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } }; diff --git a/dist/commonjs/if-core.js b/dist/commonjs/if-core.js index 7ce545b..8f9fd8c 100644 --- a/dist/commonjs/if-core.js +++ b/dist/commonjs/if-core.js @@ -32,7 +32,6 @@ var IfCore = exports.IfCore = function () { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -48,6 +47,9 @@ var IfCore = exports.IfCore = function () { IfCore.prototype._show = function _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } diff --git a/dist/commonjs/if.js b/dist/commonjs/if.js index 424d8e0..0da3b43 100644 --- a/dist/commonjs/if.js +++ b/dist/commonjs/if.js @@ -81,6 +81,8 @@ var If = exports.If = (_dec = (0, _aureliaTemplating.customAttribute)('if'), _de _IfCore.prototype.bind.call(this, bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } }; diff --git a/dist/es2015/else.js b/dist/es2015/else.js index 2b1eb9b..75b1e4c 100644 --- a/dist/es2015/else.js +++ b/dist/es2015/else.js @@ -13,7 +13,9 @@ export let Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto bind(bindingContext, overrideContext) { super.bind(bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } } diff --git a/dist/es2015/if-core.js b/dist/es2015/if-core.js index 49458ea..cffd285 100644 --- a/dist/es2015/if-core.js +++ b/dist/es2015/if-core.js @@ -23,7 +23,6 @@ export let IfCore = class IfCore { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -39,6 +38,9 @@ export let IfCore = class IfCore { _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } diff --git a/dist/es2015/if.js b/dist/es2015/if.js index 85bb583..de647e4 100644 --- a/dist/es2015/if.js +++ b/dist/es2015/if.js @@ -58,6 +58,8 @@ export let If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory, super.bind(bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } } diff --git a/dist/native-modules/else.js b/dist/native-modules/else.js index a7553c6..42f4c25 100644 --- a/dist/native-modules/else.js +++ b/dist/native-modules/else.js @@ -25,7 +25,9 @@ export var Else = (_dec = customAttribute('else'), _dec2 = inject(BoundViewFacto Else.prototype.bind = function bind(bindingContext, overrideContext) { _IfCore.prototype.bind.call(this, bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } }; diff --git a/dist/native-modules/if-core.js b/dist/native-modules/if-core.js index 0790a43..9225c5c 100644 --- a/dist/native-modules/if-core.js +++ b/dist/native-modules/if-core.js @@ -26,7 +26,6 @@ export var IfCore = function () { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -42,6 +41,9 @@ export var IfCore = function () { IfCore.prototype._show = function _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } diff --git a/dist/native-modules/if.js b/dist/native-modules/if.js index 3874b38..ecee317 100644 --- a/dist/native-modules/if.js +++ b/dist/native-modules/if.js @@ -72,6 +72,8 @@ export var If = (_dec = customAttribute('if'), _dec2 = inject(BoundViewFactory, _IfCore.prototype.bind.call(this, bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } }; diff --git a/dist/system/else.js b/dist/system/else.js index d842000..9dc65f2 100644 --- a/dist/system/else.js +++ b/dist/system/else.js @@ -58,7 +58,9 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor Else.prototype.bind = function bind(bindingContext, overrideContext) { _IfCore.prototype.bind.call(this, bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } }; diff --git a/dist/system/if-core.js b/dist/system/if-core.js index f5d3eb4..a916e42 100644 --- a/dist/system/if-core.js +++ b/dist/system/if-core.js @@ -36,7 +36,6 @@ System.register([], function (_export, _context) { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -52,6 +51,9 @@ System.register([], function (_export, _context) { IfCore.prototype._show = function _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } diff --git a/dist/system/if.js b/dist/system/if.js index 23d3ea3..9691311 100644 --- a/dist/system/if.js +++ b/dist/system/if.js @@ -106,6 +106,8 @@ System.register(['aurelia-templating', 'aurelia-dependency-injection', './if-cor _IfCore.prototype.bind.call(this, bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } }; diff --git a/dist/temp/aurelia-templating-resources.js b/dist/temp/aurelia-templating-resources.js index b77c6b0..90f6eee 100644 --- a/dist/temp/aurelia-templating-resources.js +++ b/dist/temp/aurelia-templating-resources.js @@ -420,7 +420,6 @@ var IfCore = exports.IfCore = function () { this.view.unbind(); if (!this.viewFactory.isCaching) { - this.showing = false; return; } @@ -436,6 +435,9 @@ var IfCore = exports.IfCore = function () { IfCore.prototype._show = function _show() { if (this.showing) { + if (!this.view.isBound) { + this.view.bind(this.bindingContext, this.overrideContext); + } return; } @@ -1553,7 +1555,9 @@ var Else = exports.Else = (_dec15 = (0, _aureliaTemplating.customAttribute)('els Else.prototype.bind = function bind(bindingContext, overrideContext) { _IfCore.prototype.bind.call(this, bindingContext, overrideContext); - if (!this.ifVm.condition) { + if (this.ifVm.condition) { + this._hide(); + } else { this._show(); } }; @@ -1591,6 +1595,8 @@ var If = exports.If = (_dec17 = (0, _aureliaTemplating.customAttribute)('if'), _ _IfCore2.prototype.bind.call(this, bindingContext, overrideContext); if (this.condition) { this._show(); + } else { + this._hide(); } }; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index d9cb983..2faf595 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [1.5.4](https://github.com/aurelia/templating-resources/compare/1.5.3...1.5.4) (2017-10-27) + + +### Bug Fixes + +* **if:** nested ifs don't work properly ([9548e16](https://github.com/aurelia/templating-resources/commit/9548e16)), closes [#328](https://github.com/aurelia/templating-resources/issues/328) [#327](https://github.com/aurelia/templating-resources/issues/327) [#326](https://github.com/aurelia/templating-resources/issues/326) [#322](https://github.com/aurelia/templating-resources/issues/322) [#317](https://github.com/aurelia/templating-resources/issues/317) [#315](https://github.com/aurelia/templating-resources/issues/315) + + + ## [1.5.3](https://github.com/aurelia/templating-resources/compare/1.5.2...1.5.3) (2017-10-24) diff --git a/package.json b/package.json index 04ea8de..209b4ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating-resources", - "version": "1.5.3", + "version": "1.5.4", "description": "A standard set of behaviors, converters and other resources for use with the Aurelia templating library.", "keywords": [ "aurelia",