diff --git a/PRIMER.md b/PRIMER.md index 875276b4..409ef894 100644 --- a/PRIMER.md +++ b/PRIMER.md @@ -457,13 +457,13 @@ Example: ```html - - + + ``` We say that an element definition has an imperative and declarative portion. The imperative @@ -503,15 +503,15 @@ Polymer uses "[Shadow DOM styling rules](http://www.html5rocks.com/en/tutorials/
+ + - - ``` Loading external stylesheets (as opposed to defining them inline in HTML) for styling local DOM is currently supported via a special [``](#external-stylesheets) import tag (as opposed to a ``). @@ -544,9 +544,21 @@ The following methods are provided: * `Polymer.dom(parent).appendChild(node)` * `Polymer.dom(parent).insertBefore(node, beforeNode)` * `Polymer.dom(parent).removeChild(node)` + * `Polymer.dom(parent).replaceChild(oldNode, newNode)` * `Polymer.dom(parent).querySelector(selector)` * `Polymer.dom(parent).querySelectorAll(selector)` * `Polymer.dom(parent).childNodes` + * `Polymer.dom(parent).firstChild` + * `Polymer.dom(parent).lastChild` + * `Polymer.dom(node).previousSibling` + * `Polymer.dom(node).nextSibling` + * `Polymer.dom(parent).children` + * `Polymer.dom(parent).firstElementChild` + * `Polymer.dom(parent).lastElementChild` + * `Polymer.dom(node).previousElementSibling` + * `Polymer.dom(node).nextElementSibling` + * `Polymer.dom(node).textContent` + * `Polymer.dom(node).innerHTML` * `Polymer.dom(node).parentNode` * `Polymer.dom(contentElement).getDistributedNodes()` * `Polymer.dom(node).getDestinationInsertionPoints()` @@ -670,21 +682,21 @@ Example: + + - - ``` @@ -701,25 +713,25 @@ Example:
to a click on
any of my children!
+ + - - ``` @@ -734,21 +746,21 @@ Example: + + - - ``` @@ -799,74 +811,74 @@ Example: - - + + ``` Example with `listeners`: ```html - - - - + Polymer({ + + is: 'drag-me', + + listeners: { + track: 'handleTrack' + }, + + handleTrack: function(e) { + switch(e.detail.state) { + case 'start': + this.message = 'Tracking started!'; + break; + case 'track': + this.message = 'Tracking in progress... ' + + e.detail.x + ', ' + e.detail.y; + break; + case 'end': + this.message = 'Tracking ended!'; + break; + } + } + + }); + + + ``` @@ -1075,34 +1087,35 @@ To bind to textContent, the binding annotation must currently span the entire co ```html - - - ``` @@ -1114,21 +1127,21 @@ To bind to properties, the binding annotation should be provided as the value to + + - - ``` As in the example above, paths to object sub-properties may also be specified in templates. See [Binding to structured data](#path-binding) for details. @@ -1337,21 +1350,21 @@ Example: + + - - ``` Since in the majority of cases, `notifyPath` will be called directly after an assignment, a convenience function `set` is provided that performs both the assignment and notify actions: @@ -1389,24 +1402,24 @@ Example: