Skip to content

Commit f3d41e6

Browse files
author
Ross Allen
committed
Use correct Dom capitalization in Primer doc
They were once named "localDOM" and "lightDOM", but they now use lowercase abbreviations "localDom" and "lightDom". Make sure the Primer doc refers to the correct names.
1 parent 0dea6f3 commit f3d41e6

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

PRIMER.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Example:
453453
<a name="dom-api"></a>
454454
## DOM API
455455

456-
Polymer provides custom API for manipulating dom such that local DOM and light DOM trees are properly maintained. An element has a `lightDOM` property and a `localDOM` each of which are used to manipulate their respective dom trees. The following methods are provided:
456+
Polymer provides custom API for manipulating dom such that local DOM and light DOM trees are properly maintained. An element has a `lightDom` property and a `localDom` each of which are used to manipulate their respective dom trees. The following methods are provided:
457457

458458
* appendChild(node)
459459
* insertBefore(node, ref_node)
@@ -466,12 +466,12 @@ Example:
466466

467467
```html
468468
var toLight = document.createElement('div');
469-
this.lightDOM.appendChild(toLight);
469+
this.lightDom.appendChild(toLight);
470470

471471
var toLocal = document.createElement('div');
472472
this.localDom.insertBefore(toLocal, this.localDom.children()[0]);
473473

474-
var allSpans = this.localDOM.querySelectorAll('span');
474+
var allSpans = this.localDom.querySelectorAll('span');
475475
```
476476

477477
For manipulating dom in elements that themselves do not have local dom, the above api's support an extra argument which is the container `node` in which the operation should be performed.
@@ -489,20 +489,20 @@ Example:
489489
...
490490

491491
var insert = document.createElement('div');
492-
this.localDOM.insertBefore(insert, this.$.first, this.$.container);
492+
this.localDom.insertBefore(insert, this.$.first, this.$.container);
493493

494494
```
495495

496-
**NOTE:** It's only strictly necessary to use `lightDOM/localDOM` when performing dom manipulation on elements whose composed dom and local dom is distinct. This includes elements with local dom and elements that are parents of insertion points. It is recommended, however, that `lightDOM/localDOM` be used whenever manipulating element dom.
496+
**NOTE:** It's only strictly necessary to use `lightDom/localDom` when performing dom manipulation on elements whose composed dom and local dom is distinct. This includes elements with local dom and elements that are parents of insertion points. It is recommended, however, that `lightDom/localDom` be used whenever manipulating element dom.
497497

498498
When multiple dom operations need to occur at once time, it's more efficient to batch these operations together. A batching mechanism is provided to support this use case.
499499

500500
Example:
501501

502502
```html
503-
this.localDOM.batch(function() {
503+
this.localDom.batch(function() {
504504
for (var i=0; i<10; i++) {
505-
this.localDOM.appendChild(document.createElement('div'));
505+
this.localDom.appendChild(document.createElement('div'));
506506
}
507507
});
508508

@@ -627,7 +627,7 @@ Example:
627627
listeners: {
628628
'click': 'handleClick'
629629
},
630-
630+
631631
handleClick: function(e) {
632632
alert("Thank you for clicking");
633633
}
@@ -1032,7 +1032,7 @@ Polymer provides an alternate binding annotation syntax to make it explicit when
10321032
<template>
10331033

10341034
<!-- Attribute binding -->
1035-
<my-element selected$="{{value}}"></my-element>
1035+
<my-element selected$="{{value}}"></my-element>
10361036
<!-- results in <my-element>.setAttribute('selected', this.value); -->
10371037

10381038
<!-- Property binding -->
@@ -1053,19 +1053,19 @@ In specific cases, it may be useful to keep an HTML attribute value in sync with
10531053
```html
10541054
<script>
10551055
Polymer({
1056-
1056+
10571057
published: {
10581058
response: {
10591059
type: Object,
10601060
reflect: true
10611061
}
10621062
},
1063-
1063+
10641064
responseHandler: function(response) {
10651065
this.response = 'loaded';
10661066
// results in this.setAttribute('response', 'loaded');
10671067
}
1068-
1068+
10691069
});
10701070
</script>
10711071
```
@@ -1086,11 +1086,11 @@ Polymer supports virtual properties whose values are calculated from other prope
10861086

10871087
<script>
10881088
Polymer({
1089-
1089+
10901090
is: 'x-custom',
1091-
1091+
10921092
computed: {
1093-
// when `first` or `last` changes `computeFullName` is called once
1093+
// when `first` or `last` changes `computeFullName` is called once
10941094
// (asynchronously) and the value it returns is stored as `fullName`
10951095
fullName: 'computeFullName(first, last)',
10961096
},
@@ -1115,21 +1115,21 @@ When a property only "produces" data and never consumes data, this can be made e
11151115
```html
11161116
<script>
11171117
Polymer({
1118-
1118+
11191119
published: {
11201120
response: {
11211121
type: Object,
11221122
readOnly: true,
11231123
notify: true
11241124
}
11251125
},
1126-
1126+
11271127
responseHandler: function(response) {
11281128
this._setResponse(response);
11291129
}
1130-
1130+
11311131
...
1132-
1132+
11331133
});
11341134
</script>
11351135
```
@@ -1220,13 +1220,13 @@ TL;DR: When binding to camel-cased properties, use "dash-case" attribute names t
12201220

12211221
Example: bind `this.myValue` to `<x-foo>.thatValue`:
12221222

1223-
BEFORE: 0.5
1223+
BEFORE: 0.5
12241224

12251225
```html
12261226
<x-foo thatValue="{{myValue}}"></x-foo>
12271227
```
12281228

1229-
AFTER: 0.8
1229+
AFTER: 0.8
12301230

12311231
```html
12321232
<x-foo that-value="{{myValue}}"></x-foo>
@@ -1247,13 +1247,13 @@ In the meantime, styling should be done against the composed tree, meaning:
12471247

12481248
```html
12491249
<dom-module id="x-foo">
1250-
1250+
12511251
<style>
12521252
x-foo .my-class {
12531253
...
12541254
}
12551255
</style>
1256-
1256+
12571257
<template>
12581258
...
12591259
</template>
@@ -1295,9 +1295,9 @@ Example:
12951295

12961296
<script>
12971297
Polymer({
1298-
1298+
12991299
is: 'x-parent',
1300-
1300+
13011301
bind: {
13021302
isManager: 'computeShouldDisableDebounced',
13031303
mode: 'computeShouldDisableDebounced',

0 commit comments

Comments
 (0)