Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: third_party/polymer/components-chromium/core-menu/core-submenu-extracted.js

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1
2
3 Polymer('core-submenu', {
4
5 publish: {
6 active: {value: false, reflect: true}
7 },
8
9 opened: false,
10
11 get items() {
12 return this.$.submenu.items;
13 },
14
15 hasItems: function() {
16 return !!this.items.length;
17 },
18
19 unselectAllItems: function() {
20 this.$.submenu.selected = null;
21 this.$.submenu.clearSelection();
22 },
23
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 },
36
37 activate: function() {
38 if (this.hasItems() && this.active) {
39 this.toggle();
40 this.unselectAllItems();
41 }
42 }
43
44 });
45
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698