Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Should be able to pass 0 or false as values for data to .tmpl( data ),
and have the template render against that as a valid data value.
OTOH passing no data at all, or null, is treated as rendering the template
once with no data.
  • Loading branch information
BorisMoore committed Feb 5, 2011
1 parent fe9d7e4 commit 6002457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// The content field is a hierarchical array of strings and nested items (to be
// removed and replaced by nodes field of dom elements, once inserted in DOM).
var newItem = {
data: data || (parentItem ? parentItem.data : {}),
data: data || (data === 0 || data === false) ? data : (parentItem ? parentItem.data : {}),
_wrap: parentItem ? parentItem._wrap : null,
tmpl: null,
parent: parentItem || null,
Expand Down

0 comments on commit 6002457

Please sign in to comment.