googlearchive / polymer-selector Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
In some situations it's easier to set a menu item as active
instead of setting a selected
index. For example, here's some markup from the Polymer site:
<dropdown-panel>
<polymer-ui-menu-item
src="/images/picons/ic_guide_dark_.png"
label="Start"
href="/docs/start/getting-the-code.html"
{% if page.navgroup == 'start' %}active{% endif %}>
</polymer-ui-menu-item>
<polymer-ui-menu-item
src="/images/picons/ic_book_dark_.png"
label="Docs"
href="/docs/polymer/polymer.html"
{% if page.navgroup == 'docs' %}active{% endif %}>
</polymer-ui-menu-item>
<polymer-ui-menu-item
src="/images/picons/ic_feedback_dark_.png"
label="Resources"
href="/resources/faq.html"
{% if page.navgroup == 'resources' %}active{% endif %}>
</polymer-ui-menu-item>
<polymer-ui-menu-item
src="/images/picons/ic_people_dark.png"
label="Community"
href="/discuss.html"
{% if page.navgroup == 'community' %}active{% endif %}>
</polymer-ui-menu-item>
</dropdown-panel>
Is it possible for polymer-selector to do an initial check of its children to determine which item is selected? Without this check, if I assign another item as selected it will not remove the original active
attribute and I end up with two active
items.
Currently, polymer-selector only observes changes to selectedItem
. Could it also observe changes to selectedModel
? I would like to dynamically change selection by specifying a data object in my array, without caring what HTML element does it bind to.
I think Polymer website would also benefit from that because currently it does quite a lot of work to expand an item in the menu: https://github.com/Polymer/docs/blob/39329d74c0511e5fd8d7bfe3d380cc70b0f116f1/elements/docs-menu.html#L73 (see method highlightItemWithURL
)
polymer-ui-menu extends polymer-selector and the selector target is the menu itself. It would be useful to be able to locate the menu items as other than direct children of the menu. The itemsSelector property is intended for this use but it only works if the selector targets another element.
This would be useful for this type of construction:
<polymer-ui-menu>
<a><polymer-ui-menu-item></polymer-ui-menu-item></a>
...
See this thread for more info: https://groups.google.com/forum/#!topic/polymer-dev/CTumvA_cTtE
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.