Skip to content

Commit

Permalink
Release v1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Kinast committed Apr 29, 2015
1 parent 6862449 commit 39ba918
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Change Log

### v1.7.0 (2015/04/18 00:24 +00:00)
### v1.7.1 (2015/04/29 02:39 +00:00)
- [#136](https://github.com/linkedin/dustjs-helpers/pull/136) Sync linkedin/dustjs#650 (@sethkinast)
- [#135](https://github.com/linkedin/dustjs-helpers/pull/135) Evaluate truth test bodies inside a @select before resolving the select. (@sethkinast)

### v1.7.0 (2015/04/18 00:26 +00:00)
- [#133](https://github.com/linkedin/dustjs-helpers/pull/133) Don't require a key for `{@select}` (@sethkinast)
- [#129](https://github.com/linkedin/dustjs-helpers/pull/129) Refactor for 1.7 (@sethkinast)
- [#132](https://github.com/linkedin/dustjs-helpers/pull/132) Drop 0.8 support and bump dust core dependency (@sethkinast)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dustjs-helpers",
"version": "1.7.0",
"version": "1.7.1",
"homepage": "https://github.com/linkedin/dustjs-helpers",
"authors": [
"Veena Basavaraj <vybs@users.noreply.github.com>",
Expand Down
21 changes: 14 additions & 7 deletions dist/dust-helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! dustjs-helpers - v1.7.0
/*! dustjs-helpers - v1.7.1
* http://dustjs.com/
* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */
(function(root, factory) {
Expand Down Expand Up @@ -51,6 +51,7 @@ function addSelectState(context, opts) {
}

var state = {
isPending: false,
isResolved: false,
isDeferredComplete: false,
deferreds: []
Expand Down Expand Up @@ -108,7 +109,7 @@ function filter(chunk, context, bodies, params, helperName, test) {
var body = bodies.block,
skip = bodies.else,
selectState = getSelectState(context) || {},
key, value, type;
willResolve, key, value, type;

// Once one truth test in a select passes, short-circuit the rest of the tests
if (selectState.isResolved) {
Expand All @@ -131,14 +132,20 @@ function filter(chunk, context, bodies, params, helperName, test) {
value = coerce(context.resolve(params.value), type);

if (test(key, value)) {
if (selectState) {
selectState.isResolved = true;
// Once a truth test passes, put the select into "pending" state. Now we can render the body of
// the truth test (which may contain truth tests) without altering the state of the select.
if (!selectState.isPending) {
willResolve = true;
selectState.isPending = true;
}
if(body) {
return chunk.render(body, context);
if (body) {
chunk = chunk.render(body, context);
}
if (willResolve) {
selectState.isResolved = true;
}
} else if (skip) {
return chunk.render(skip, context);
chunk = chunk.render(skip, context);
}
return chunk;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/dust-helpers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dustjs-helpers",
"version": "1.7.0",
"version": "1.7.1",
"author": {
"name": "Aleksander Williams",
"url": "http://akdubya.github.com/dustjs"
Expand Down

0 comments on commit 39ba918

Please sign in to comment.