Port Android relocation packer to chromium build
[chromium-blink-merge.git] / third_party / polymer / components-chromium / core-menu / core-submenu-extracted.js
blob0f0c38587971b3ac1ffc0ac6c9bc361345cfd720
3 Polymer('core-submenu', {
5 publish: {
6 active: {value: false, reflect: true}
7 },
9 opened: false,
11 get items() {
12 return this.$.submenu.items;
15 hasItems: function() {
16 return !!this.items.length;
19 unselectAllItems: function() {
20 this.$.submenu.selected = null;
21 this.$.submenu.clearSelection();
24 activeChanged: function() {
25 if (this.hasItems()) {
26 this.opened = this.active;
28 if (!this.active) {
29 this.unselectAllItems();
33 toggle: function() {
34 this.opened = !this.opened;
37 activate: function() {
38 if (this.hasItems() && this.active) {
39 this.toggle();
40 this.unselectAllItems();
44 });