Skip to content

Commit cecf895

Browse files
committed
Call the template instance template, not this
But keep some occurrences of `this` for clarity; for example, “in a rendered callback you can use `this.findAll`”.
1 parent d951e45 commit cecf895

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

docs/client/api.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ <h2 id="templates_api"><span>Templates</span></h2>
20972097
object.
20982098

20992099
Because your template has been rendered, you can use functions like
2100-
`this.findAll` which look at its DOM nodes.
2100+
[`this.findAll`](#template_findAll) which look at its DOM nodes.
21012101

21022102
{{> api_box template_created}}
21032103

@@ -2154,9 +2154,9 @@ <h2 id="template_inst"><span>Template instances</span></h2>
21542154

21552155
{{> api_box template_findAll}}
21562156

2157-
`this.findAll` returns an array of DOM elements matching `selector`.
2157+
`template.findAll` returns an array of DOM elements matching `selector`.
21582158

2159-
`this.$` returns a [jQuery object](http://api.jquery.com/Types/#jQuery) of
2159+
`template.$` returns a [jQuery object](http://api.jquery.com/Types/#jQuery) of
21602160
those same elements. jQuery objects are similar to arrays, with
21612161
additional methods defined by the jQuery library.
21622162

@@ -2196,7 +2196,7 @@ <h2 id="template_inst"><span>Template instances</span></h2>
21962196
or the template instance. The Computation is automatically stopped
21972197
when the template is destroyed.
21982198

2199-
Alias for `this.view.autorun`.
2199+
Alias for `template.view.autorun`.
22002200

22012201
{{> api_box template_view}}
22022202

@@ -2335,7 +2335,7 @@ <h2 id="ui"><span>Template utilities</span></h2>
23352335
advanced applications and packages.
23362336

23372337
You can obtain a View object by calling [`UI.render`](#ui_render) on a
2338-
template, or by accessing [`this.view`](#template_view) on a template
2338+
template, or by accessing [`template.view`](#template_view) on a template
23392339
instance.
23402340

23412341
At the heart of a View is an [autorun](#tracker_autorun) that calls the View's

docs/client/api.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ Template.api.template_helpers = {
17711771

17721772
Template.api.template_findAll = {
17731773
id: "template_findAll",
1774-
name: "<em>this</em>.findAll(selector) and <em>this</em>.$(selector)",
1774+
name: "<em>template</em>.findAll(selector) and <em>template</em>.$(selector)",
17751775
locus: "Client",
17761776
descr: ["Find all elements matching `selector` in this template instance."],
17771777
args: [
@@ -1783,7 +1783,7 @@ Template.api.template_findAll = {
17831783

17841784
Template.api.template_find = {
17851785
id: "template_find",
1786-
name: "<em>this</em>.find(selector)",
1786+
name: "<em>template</em>.find(selector)",
17871787
locus: "Client",
17881788
descr: ["Find one element matching `selector` in this template instance."],
17891789
args: [
@@ -1795,28 +1795,28 @@ Template.api.template_find = {
17951795

17961796
Template.api.template_firstNode = {
17971797
id: "template_firstNode",
1798-
name: "<em>this</em>.firstNode",
1798+
name: "<em>template</em>.firstNode",
17991799
locus: "Client",
18001800
descr: ["The first top-level DOM node in this template instance."]
18011801
};
18021802

18031803
Template.api.template_lastNode = {
18041804
id: "template_lastNode",
1805-
name: "<em>this</em>.lastNode",
1805+
name: "<em>template</em>.lastNode",
18061806
locus: "Client",
18071807
descr: ["The last top-level DOM node in this template instance."]
18081808
};
18091809

18101810
Template.api.template_data = {
18111811
id: "template_data",
1812-
name: "<em>this</em>.data",
1812+
name: "<em>template</em>.data",
18131813
locus: "Client",
18141814
descr: ["The data context of this instance's latest invocation."]
18151815
};
18161816

18171817
Template.api.template_autorun = {
18181818
id: "template_autorun",
1819-
name: "<em>this</em>.autorun(runFunc)",
1819+
name: "<em>template</em>.autorun(runFunc)",
18201820
locus: "Client",
18211821
descr: ["A version of [Tracker.autorun](#tracker_autorun) that is stopped when the template is destroyed."],
18221822
args: [
@@ -1828,7 +1828,7 @@ Template.api.template_autorun = {
18281828

18291829
Template.api.template_view = {
18301830
id: "template_view",
1831-
name: "<em>this</em>.view",
1831+
name: "<em>template</em>.view",
18321832
locus: "Client",
18331833
descr: ["The [View](#ui_view) object for this invocation of the template."]
18341834
};

docs/client/docs.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ var toc = [
248248
{name: "destroyed", id: "template_destroyed"}
249249
],
250250
{name: "Template instances", id: "template_inst"}, [
251-
{instance: "this", name: "findAll", id: "template_findAll"},
252-
{instance: "this", name: "$", id: "template_findAll"},
253-
{instance: "this", name: "find", id: "template_find"},
254-
{instance: "this", name: "firstNode", id: "template_firstNode"},
255-
{instance: "this", name: "lastNode", id: "template_lastNode"},
256-
{instance: "this", name: "data", id: "template_data"},
257-
{instance: "this", name: "autorun", id: "template_autorun"},
258-
{instance: "this", name: "view", id: "template_view"}
251+
{instance: "template", name: "findAll", id: "template_findAll"},
252+
{instance: "template", name: "$", id: "template_findAll"},
253+
{instance: "template", name: "find", id: "template_find"},
254+
{instance: "template", name: "firstNode", id: "template_firstNode"},
255+
{instance: "template", name: "lastNode", id: "template_lastNode"},
256+
{instance: "template", name: "data", id: "template_data"},
257+
{instance: "template", name: "autorun", id: "template_autorun"},
258+
{instance: "template", name: "view", id: "template_view"}
259259
],
260260
"Template.body",
261261
"UI", [

0 commit comments

Comments
 (0)