Add an exponential backoff to rechecking the app list doodle.
[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;
13     },
15     hasItems: function() {
16       return !!this.items.length;
17     },
19     unselectAllItems: function() {
20       this.$.submenu.selected = null;
21       this.$.submenu.clearSelection();
22     },
24     activeChanged: function() {
25       if (this.hasItems()) {
26         this.opened = this.active;
27       }
28       if (!this.active) {
29         this.unselectAllItems();
30       }
31     },
32     
33     toggle: function() {
34       this.opened = !this.opened;
35     },
37     activate: function() {
38       if (this.hasItems() && this.active) {
39         this.toggle();
40         this.unselectAllItems();
41       }
42     }
43     
44   });