make #with work

This commit is contained in:
David Greenspan
2013-09-17 14:32:03 -07:00
parent 4add01f934
commit 0bf617ed47
2 changed files with 10 additions and 1 deletions

View File

@@ -62,3 +62,10 @@ UI.Unless = Component.extend({
buf.write(condition ? self.elseContent : self.content);
}
});
UI.With = Component.extend({
kind: 'With',
render: function (buf) {
buf.write(this.content);
}
});

View File

@@ -1,6 +1,8 @@
var global = (function () { return this; })();
// XXXXXXXX take out the "look up the tree" logic for Stage I
_extend(UI.Component, {
// _dontCall is for internal use only.
//
@@ -26,7 +28,7 @@ _extend(UI.Component, {
} else if (id === 'unless') {
result = UI.Unless;
} else if (id === 'with') {
result = Component;
result = UI.With;
} else if (/^[A-Z]/.test(id) && (id in global)) {
// Only look for a global identifier if `id` is
// capitalized. This avoids have `{{name}}` mean