Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mercmobily/hot-deep-target-behavior
Hot deep query behavior
https://github.com/mercmobily/hot-deep-target-behavior
Last synced: about 2 months ago
JSON representation
Hot deep query behavior
- Host: GitHub
- URL: https://github.com/mercmobily/hot-deep-target-behavior
- Owner: mercmobily
- License: mit
- Created: 2016-07-31T05:57:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-25T15:05:56.000Z (over 8 years ago)
- Last Synced: 2024-11-11T23:54:01.095Z (2 months ago)
- Language: HTML
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `hot-deep-target-behavior`
Polymer behaviors that will give your elements the ability to have a selector in their attribute. The selector will do a _deep_ search into _all_ effective/distributed children. This means that you can write an element like this:
```
This is the light DOM for this element
```
The `_target`property of `your-element` will be the `paper-input` element.
Three behaviors are defined:
## `Hotplate.DeepTargetBehavior`
Using this behavior, your element will have the property `target-id`, which will accept a selector. When your element is `ready()`ed, it will do a _deep_ search into its effective/distributed children, and will make sure that `_target` will point to the first matching element.
## `Hotplate.DeepSelectorsBehavior`
(cover `excludeSelector`)
## `Hotplate.DeepAllSelectorsBehavior`
(cover `excludeSelector`)
## Low level functions available when including this file
By including `hot-deep-target-behavior.html`, your element will have access to:
- `queryEffectiveChildrenDeep( slctr, excludeSlctr )`
- `queryAllEffectiveChildrenDeep( slctr, excludeSlctr )`
- `Polymer( node ).queryDistributedElementsDeep(selectors, firstOnly, excludeSelector)` (used by the two previous calls)They mirror the calls available in Polymer. Apart from the `Deep` postfix, they are compatible. The optional `firstOnly` parameter allows to have more optimised code, since the search will stop after the first occurrence is found. The optional parameter `excludeSelector` is there to allow widgets to set sections of the searching tree as impenetrable.