Skip to content

Commit

Permalink
v3.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
edi9999 committed May 24, 2018
1 parent 5b619f1 commit 54f74e9
Show file tree
Hide file tree
Showing 4 changed files with 4,895 additions and 8 deletions.
16 changes: 9 additions & 7 deletions build/docxtemplater-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1377,14 +1377,16 @@ var loopModule = {
totalValue = totalValue.concat(subRendered.parts);
errors = errors.concat(subRendered.errors || []);
}
options.scopeManager.loopOver(part.value, loopOver, part.inverted);
options.scopeManager.loopOver(part.value, loopOver, part.inverted, {
part: part
});
return { value: totalValue.join(""), errors: errors };
},
resolve: function resolve(part, options) {
if (!part.type === "placeholder" || part.module !== moduleName) {
return null;
}
var value = options.scopeManager.getValue(part.value);
var value = options.scopeManager.getValue(part.value, { part: part });
var promises = [];
function loopOver(scope, i) {
var scopeManager = options.scopeManager.createSubScopeManager(scope, part.value, i);
Expand Down Expand Up @@ -1579,7 +1581,7 @@ var Render = function () {
if (p.type === "placeholder") {
var tag = p.value;
try {
_this2.parser(tag);
_this2.parser(tag, { tag: p });
} catch (rootError) {
errors.push(getScopeCompilationError({ tag: tag, rootError: rootError }));
}
Expand Down Expand Up @@ -1789,7 +1791,7 @@ function render(options) {
return moduleRendered.value;
}
if (part.type === "placeholder") {
var value = scopeManager.getValue(part.value);
var value = scopeManager.getValue(part.value, { part: part });
if (value == null) {
value = nullGetter(part);
}
Expand Down Expand Up @@ -1841,7 +1843,7 @@ function resolve(options) {
});
}
if (part.type === "placeholder") {
return scopeManager.getValueAsync(part.value).then(function (value) {
return scopeManager.getValueAsync(part.value, { part: part }).then(function (value) {
if (value == null) {
value = nullGetter(part);
}
Expand Down Expand Up @@ -1895,9 +1897,9 @@ var ScopeManager = function () {

_createClass(ScopeManager, [{
key: "loopOver",
value: function loopOver(tag, callback, inverted) {
value: function loopOver(tag, callback, inverted, meta) {
inverted = inverted || false;
return this.loopOverValue(this.getValue(tag), callback, inverted);
return this.loopOverValue(this.getValue(tag, meta), callback, inverted);
}
}, {
key: "functorIfInverted",
Expand Down
2 changes: 1 addition & 1 deletion build/docxtemplater-latest.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 54f74e9

Please sign in to comment.