From f3d41e6bd68f2ed6103c898b6be68fe0c47063b3 Mon Sep 17 00:00:00 2001 From: Ross Allen Date: Wed, 25 Feb 2015 15:06:26 -0800 Subject: [PATCH] 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. --- PRIMER.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/PRIMER.md b/PRIMER.md index 0baf88beb0..b6564d8266 100644 --- a/PRIMER.md +++ b/PRIMER.md @@ -453,7 +453,7 @@ Example: ## DOM API -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: +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: * appendChild(node) * insertBefore(node, ref_node) @@ -466,12 +466,12 @@ Example: ```html var toLight = document.createElement('div'); - this.lightDOM.appendChild(toLight); + this.lightDom.appendChild(toLight); var toLocal = document.createElement('div'); this.localDom.insertBefore(toLocal, this.localDom.children()[0]); - var allSpans = this.localDOM.querySelectorAll('span'); + var allSpans = this.localDom.querySelectorAll('span'); ``` 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: ... var insert = document.createElement('div'); -this.localDOM.insertBefore(insert, this.$.first, this.$.container); +this.localDom.insertBefore(insert, this.$.first, this.$.container); ``` -**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. +**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. 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. Example: ```html -this.localDOM.batch(function() { +this.localDom.batch(function() { for (var i=0; i<10; i++) { - this.localDOM.appendChild(document.createElement('div')); + this.localDom.appendChild(document.createElement('div')); } }); @@ -627,7 +627,7 @@ Example: listeners: { 'click': 'handleClick' }, - + handleClick: function(e) { alert("Thank you for clicking"); } @@ -1032,7 +1032,7 @@ Polymer provides an alternate binding annotation syntax to make it explicit when