mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
steps toward test driver working
This commit is contained in:
@@ -13,7 +13,7 @@ Package.on_use(function (api) {
|
||||
|
||||
api.use('session');
|
||||
|
||||
api.use(['spark', 'livedata', 'templating', 'deps'], 'client');
|
||||
api.use(['ui', 'livedata', 'deps'], 'client');
|
||||
|
||||
api.add_files([
|
||||
'driver.css',
|
||||
|
||||
@@ -565,6 +565,10 @@ _.extend(Component.prototype, {
|
||||
result = If;
|
||||
} else if (id === 'each') {
|
||||
result = Each;
|
||||
} else if (id === 'unless') {
|
||||
result = Unless;
|
||||
} else if (id === 'with') {
|
||||
result = Component;
|
||||
} else if (id in global) {
|
||||
result = global[id];
|
||||
thisToBind = self.getData();
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
// @export If
|
||||
If = Component.extend({
|
||||
init: function () {
|
||||
if (! this.getArg('content'))
|
||||
throw new Error("If requires content");
|
||||
},
|
||||
render: function (buf) {
|
||||
if (this.getArg('data'))
|
||||
buf.component(this.getArg('content').create());
|
||||
else if (this.getArg('elseContent'))
|
||||
buf.component(this.getArg('elseContent'));
|
||||
if (this.getArg('data')) {
|
||||
if (this.getArg('content'))
|
||||
buf.component(this.getArg('content').create());
|
||||
} else if (this.getArg('elseContent')) {
|
||||
buf.component(this.getArg('elseContent').create());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// @export Unless
|
||||
Unless = Component.extend({
|
||||
render: function (buf) {
|
||||
if (! this.getArg('data')) {
|
||||
if (this.getArg('content'))
|
||||
buf.component(this.getArg('content').create());
|
||||
} else if (this.getArg('elseContent')) {
|
||||
buf.component(this.getArg('elseContent').create());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user