Permalink
Browse files

Bugfix: eachModifier handlebars helper would bomb if passed a section…

… parameter.
  • Loading branch information...
1 parent d1cb207 commit bfc7e54420e771916c194ff33f46042872206b0d @JohnAlbin JohnAlbin committed Jul 19, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 bin/kss-node
View
@@ -409,14 +409,14 @@ handlebars.registerHelper('whenDepth', function(depth, options) {
* Similar to the {#eachSection} helper, however will loop over each modifier
* @param {Object} section Supply a section object to loop over it's modifiers. Defaults to the current section.
*/
-handlebars.registerHelper('eachModifier', function(options) {
+handlebars.registerHelper('eachModifier', function() {
var modifiers,
+ options = arguments[arguments.length - 1],
buffer = '',
i, l;
- // Default to current modifiers, but allow supplying a custom section
- if (options.data) modifiers = options.data.modifiers;
- modifiers = modifiers || this.modifiers || false;
+ // Default to current modifiers, but allow supplying a custom section.
+ modifiers = (arguments.length > 1 && arguments[0].data) ? arguments[0].data.modifiers : this.modifiers;
if (!modifiers) return {};

0 comments on commit bfc7e54

Please sign in to comment.