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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js

Issue 2839293002: Roll some polymer elements and remove stuff from chromium.patch (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js
index 7ca7c022b4b67e9382d996cdb0711862d0841a09..e25ce7cbee07936d16d521672f943d432a8166d6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-menu/paper-submenu-extracted.js
@@ -54,7 +54,7 @@
this.listen(this.__parent, 'iron-activate', '_onParentIronActivate');
},
- dettached: function() {
+ detached: function() {
this.unlisten(this.__parent, 'iron-activate', '_onParentIronActivate');
},
@@ -62,11 +62,8 @@
* Expand the submenu content.
*/
open: function() {
- if (!this.disabled && !this._active) {
- this.$.collapse.show();
- this._active = true;
- this.__trigger && this.__trigger.classList.add('iron-selected');
- this.__content && this.__content.focus();
+ if (!this.disabled) {
+ this.opened = true;
}
},
@@ -74,18 +71,14 @@
* Collapse the submenu content.
*/
close: function() {
- if (this._active) {
- this.$.collapse.hide();
- this._active = false;
- this.__trigger && this.__trigger.classList.remove('iron-selected');
- }
+ this.opened = false;
},
/**
* Toggle the submenu.
*/
toggle: function() {
- if (this._active) {
+ if (this.opened) {
this.close();
} else {
this.open();
@@ -106,8 +99,11 @@
*/
_openedChanged: function(opened, oldOpened) {
if (opened) {
+ this.__trigger && this.__trigger.classList.add('iron-selected');
+ this.__content && this.__content.focus();
this.fire('paper-submenu-open');
} else if (oldOpened != null) {
+ this.__trigger && this.__trigger.classList.remove('iron-selected');
this.fire('paper-submenu-close');
}
},
@@ -137,7 +133,7 @@
*/
_disabledChanged: function(disabled) {
Polymer.IronControlState._disabledChanged.apply(this, arguments);
- if (disabled && this._active) {
+ if (disabled && this.opened) {
this.close();
}
},

Powered by Google App Engine
This is Rietveld 408576698