Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava committed Apr 2, 2015
2 parents 779f942 + 21f5990 commit cdaaa6b
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 15 deletions.
7 changes: 7 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
just like it does with Numbers and Strings. This applies to the `check`
function as well.

## v1.1.0.1, 2015-Apr-02

### Blaze

* Fix a regression in 1.1 in Blaze Templates: an error happening when View is
invalidated immediately, causing a client-side crash (accessing
`destroyMembers` of `undefined`). #4097

## v1.1, 2015-Mar-31

Expand Down
4 changes: 2 additions & 2 deletions docs/client/basic/sections/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ You can perform initialization or clean-up on any objects in
callbacks.

For example, to use the HighlightJS library to apply code highlighting to
all `<pre>` elements inside the `codeSample` template, you might assign
the following function to `Template.codeSample.rendered`:
all `<pre>` elements inside the `codeSample` template, you might pass
the following function to `Template.codeSample.onRendered`:

```
Template.codeSample.onRendered(function () {
Expand Down
18 changes: 9 additions & 9 deletions docs/client/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ DocsData = {
"Blaze.TemplateInstance#subscribe": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 341,
"lineno": 344,
"locus": "Client",
"longname": "Blaze.TemplateInstance#subscribe",
"memberof": "Blaze.TemplateInstance",
Expand Down Expand Up @@ -1358,7 +1358,7 @@ DocsData = {
"Blaze.TemplateInstance#subscriptionsReady": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 404,
"lineno": 424,
"longname": "Blaze.TemplateInstance#subscriptionsReady",
"memberof": "Blaze.TemplateInstance",
"name": "subscriptionsReady",
Expand Down Expand Up @@ -2585,7 +2585,7 @@ DocsData = {
"Email.send": {
"filepath": "email/email.js",
"kind": "function",
"lineno": 126,
"lineno": 128,
"locus": "Server",
"longname": "Email.send",
"memberof": "Email",
Expand Down Expand Up @@ -5625,7 +5625,7 @@ DocsData = {
"Template#events": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 448,
"lineno": 468,
"locus": "Client",
"longname": "Template#events",
"memberof": "Template",
Expand All @@ -5648,7 +5648,7 @@ DocsData = {
"Template#helpers": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 419,
"lineno": 439,
"locus": "Client",
"longname": "Template#helpers",
"memberof": "Template",
Expand Down Expand Up @@ -5760,7 +5760,7 @@ DocsData = {
"Template.currentData": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 502,
"lineno": 522,
"locus": "Client",
"longname": "Template.currentData",
"memberof": "Template",
Expand Down Expand Up @@ -5807,7 +5807,7 @@ DocsData = {
"Template.instance": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 472,
"lineno": 492,
"locus": "Client",
"longname": "Template.instance",
"memberof": "Template",
Expand All @@ -5829,7 +5829,7 @@ DocsData = {
"Template.parentData": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 510,
"lineno": 530,
"locus": "Client",
"longname": "Template.parentData",
"memberof": "Template",
Expand All @@ -5853,7 +5853,7 @@ DocsData = {
"Template.registerHelper": {
"filepath": "blaze/template.js",
"kind": "function",
"lineno": 519,
"lineno": 539,
"locus": "Client",
"longname": "Template.registerHelper",
"memberof": "Template",
Expand Down
40 changes: 40 additions & 0 deletions docs/client/full-api/api/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@ initialization or clean-up on the object.
Because your template has been rendered, you can use functions like
[`this.findAll`](#template_findAll) which look at its DOM nodes.

This can be a good place to apply any DOM manipulations you want, after the
template is rendered for the first time.

```html
<template name="myPictures">
<div class="container">
{{#each pictures}}
<img class=".item" src="/{{.}}"/>
{{/each}}
</div>
</template>
```

```javascript
Template.myPictures.onRendered(function () {
// Use the Packery jQuery plugin
this.$('.container').packery({
itemSelector: '.item',
gutter: 10
});
});
```

{{> autoApiBox "Template#onCreated"}}

Callbacks added with this method called before your template's logic is
Expand All @@ -97,6 +120,16 @@ These callbacks fire once and are the first group of callbacks to fire.
Handling the `created` event is a useful way to set up values on template
instance that are read from template helpers using `Template.instance()`.

```javascript
Template.myPictures.onCreated(function () {
// set up local reactive variables
this.highlightedPicture = new ReactiveVar(null);

// register this template within some central store
GalleryTemplates.push(this);
});
```

{{> autoApiBox "Template#onDestroyed"}}

These callbacks are called when an occurrence of a template is taken off
Expand All @@ -108,6 +141,13 @@ This group of callbacks is most useful for cleaning up or undoing any external
effects of `created` or `rendered` groups. This group fires once and is the last
callback to fire.

```javascript
Template.myPictures.onDestroyed(function () {
// deregister from some central store
GalleryTemplates = _.without(GalleryTemplates, this);
});
```


<h2 id="template_inst"><span>Template instances</span></h2>

Expand Down
2 changes: 1 addition & 1 deletion packages/blaze/package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
summary: "Meteor Reactive Templating library",
version: '2.1.1'
version: '2.1.2'
});

Package.onUse(function (api) {
Expand Down
2 changes: 1 addition & 1 deletion packages/meteor-tool/package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
summary: "The Meteor command-line tool",
version: '1.1.1'
version: '1.1.2'
});

Package.includeTool();
8 changes: 7 additions & 1 deletion scripts/admin/banners.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
"0.9.2.1", "0.9.2.2", "0.9.3", "0.9.3.1", "0.9.4", "1.0", "1.0.1", "1.0.2", "1.0.2.1",
"1.0.3", "1.0.3.1", "1.0.3.2", "1.0.4", "1.0.4.1", "1.0.4.2", "1.0.5"],
"banner": {
"text": "=> Meteor 1.1: official Windows support, new package version constraint solver.\n\n\n This release is being downloaded in the background. Update your app to\n Meteor 1.1 by running 'meteor update'."
"text": "=> Meteor 1.1.0.1: official Windows support, new package version constraint solver.\n\n\n This release is being downloaded in the background. Update your app to\n Meteor 1.1.0.1 by running 'meteor update'."
}
},
{
"versions": ["1.1"],
"banner": {
"text": "=> Meteor 1.1.0.1: fixes a client-side Blaze crash regression in 1.1.\n\n\n This release is being downloaded in the background. Update your app to\n Meteor 1.1.0.1 by running 'meteor update'."
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion scripts/admin/meteor-release-official.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"track": "METEOR",
"version": "1.1",
"version": "1.1.0.1",
"recommended": false,
"official": true,
"description": "The Official Meteor Distribution"
Expand Down

0 comments on commit cdaaa6b

Please sign in to comment.