mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
render content() by default
This commit is contained in:
@@ -49,6 +49,7 @@ Template.item({
|
||||
//});
|
||||
|
||||
Span = UIComponent.extend({
|
||||
typeName: 'Span',
|
||||
render: function (buf) {
|
||||
buf("<span ",
|
||||
{ attrs: function () {
|
||||
@@ -69,6 +70,7 @@ Span = UIComponent.extend({
|
||||
});
|
||||
|
||||
Div = UIComponent.extend({
|
||||
typeName: 'Div',
|
||||
render: function (buf) {
|
||||
buf("<div style='background:cyan;margin:5px'>World",
|
||||
"<input type=checkbox ",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var Component = UIComponent;
|
||||
|
||||
_UI.Text = Component.extend({
|
||||
typeName: 'Text',
|
||||
_encodeEntities: _UI.encodeSpecialEntities,
|
||||
_stringify: function (x) {
|
||||
return String(x == null ? '' : x);
|
||||
@@ -12,6 +13,7 @@ _UI.Text = Component.extend({
|
||||
});
|
||||
|
||||
_UI.HTML = Component.extend({
|
||||
typeName: 'HTML',
|
||||
_stringify: function (x) {
|
||||
return String(x == null ? '' : x);
|
||||
},
|
||||
@@ -22,8 +24,7 @@ _UI.HTML = Component.extend({
|
||||
});
|
||||
|
||||
_UI.If = Component.extend({
|
||||
content: function () { return null; },
|
||||
elseContent: function () { return null; },
|
||||
typeName: 'If',
|
||||
render: function (buf) {
|
||||
var self = this;
|
||||
var condition = Deps.isolate(function () {
|
||||
|
||||
@@ -113,7 +113,12 @@ Component({
|
||||
// It's a DIV rather than a fragment so that jQuery can run against it.
|
||||
_offscreen: null,
|
||||
|
||||
render: function (buf) {},
|
||||
content: function () { return null; },
|
||||
elseContent: function () { return null; },
|
||||
|
||||
render: function (buf) {
|
||||
buf(this.content());
|
||||
},
|
||||
|
||||
_populate: function (div) {
|
||||
var self = this;
|
||||
@@ -690,7 +695,6 @@ Component({
|
||||
|
||||
// Next up:
|
||||
//
|
||||
// - content()
|
||||
// - Spacebars compiler
|
||||
// - event maps
|
||||
// - preview HTML
|
||||
|
||||
Reference in New Issue
Block a user