Quellcode durchsuchen

Partials within list sections did not seem to be functioning

correctly. Since a list section pushes a sub-object of the
"view" into the "current" context, a partial should recognize
this altered context. The one-line change in mustache.js does
exactly this.

Closes #35.
tags/0.3.0
Aaron Gibralter Jan Lehnardt <jan@apache.org> vor 16 Jahren
Ursprung
Commit
53e9b2692b
9 geänderte Dateien mit 28 neuen und 1 gelöschten Zeilen
  1. +1
    -0
      examples/array_of_partials_implicit_partial.2.html
  2. +5
    -0
      examples/array_of_partials_implicit_partial.html
  3. +3
    -0
      examples/array_of_partials_implicit_partial.js
  4. +5
    -0
      examples/array_of_partials_implicit_partial.txt
  5. +1
    -0
      examples/array_of_partials_partial.2.html
  6. +4
    -0
      examples/array_of_partials_partial.html
  7. +3
    -0
      examples/array_of_partials_partial.js
  8. +5
    -0
      examples/array_of_partials_partial.txt
  9. +1
    -1
      mustache.js

+ 1
- 0
examples/array_of_partials_implicit_partial.2.html Datei anzeigen

@@ -0,0 +1 @@
{{.}}

+ 5
- 0
examples/array_of_partials_implicit_partial.html Datei anzeigen

@@ -0,0 +1,5 @@
Here is some stuff!
{{%IMPLICIT-ITERATOR}}
{{#numbers}}
{{>partial}}
{{/numbers}}

+ 3
- 0
examples/array_of_partials_implicit_partial.js Datei anzeigen

@@ -0,0 +1,3 @@
var partial_context = {
numbers: ['1', '2', '3', '4']
};

+ 5
- 0
examples/array_of_partials_implicit_partial.txt Datei anzeigen

@@ -0,0 +1,5 @@
Here is some stuff!
1
2
3
4

+ 1
- 0
examples/array_of_partials_partial.2.html Datei anzeigen

@@ -0,0 +1 @@
{{i}}

+ 4
- 0
examples/array_of_partials_partial.html Datei anzeigen

@@ -0,0 +1,4 @@
Here is some stuff!
{{#numbers}}
{{>partial}}
{{/numbers}}

+ 3
- 0
examples/array_of_partials_partial.js Datei anzeigen

@@ -0,0 +1,3 @@
var partial_context = {
numbers: [{i: '1'}, {i: '2'}, {i: '3'}, {i: '4'}]
};

+ 5
- 0
examples/array_of_partials_partial.txt Datei anzeigen

@@ -0,0 +1,5 @@
Here is some stuff!
1
2
3
4

+ 1
- 1
mustache.js Datei anzeigen

@@ -89,7 +89,7 @@ var Mustache = function() {
throw({message: "unknown_partial '" + name + "'"});
}
if(typeof(context[name]) != "object") {
return partials[name];
return this.render(partials[name], context, partials, true);
}
return this.render(partials[name], context[name], partials, true);
},


Laden…
Abbrechen
Speichern