Index: third_party/polymer/components/paper-menu/paper-submenu.html |
diff --git a/third_party/polymer/components/paper-menu/paper-submenu.html b/third_party/polymer/components/paper-menu/paper-submenu.html |
index e1c1d111cdb4c457638d07c79e0fe61b32b0dd4e..4fadb87ed0580566a85c34d82dee86bbc0a2d062 100644 |
--- a/third_party/polymer/components/paper-menu/paper-submenu.html |
+++ b/third_party/polymer/components/paper-menu/paper-submenu.html |
@@ -9,12 +9,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
--> |
<link rel="import" href="../polymer/polymer.html"> |
-<link rel="import" href="../iron-menu-behavior/iron-menu-behavior.html"> |
<link rel="import" href="../iron-behaviors/iron-control-state.html"> |
<link rel="import" href="../iron-collapse/iron-collapse.html"> |
-<link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> |
-<link rel="import" href="../paper-styles/default-theme.html"> |
-<link rel="import" href="../paper-styles/color.html"> |
<link rel="import" href="paper-menu-shared-styles.html"> |
<!-- |
@@ -127,7 +123,7 @@ item has bolded text. Please see the `<paper-menu>` docs for which attributes |
this.listen(this.__parent, 'iron-activate', '_onParentIronActivate'); |
}, |
- dettached: function() { |
+ detached: function() { |
this.unlisten(this.__parent, 'iron-activate', '_onParentIronActivate'); |
}, |
@@ -135,11 +131,8 @@ item has bolded text. Please see the `<paper-menu>` docs for which attributes |
* 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; |
} |
}, |
@@ -147,18 +140,14 @@ item has bolded text. Please see the `<paper-menu>` docs for which attributes |
* 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(); |
@@ -179,8 +168,11 @@ item has bolded text. Please see the `<paper-menu>` docs for which attributes |
*/ |
_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'); |
} |
}, |
@@ -210,7 +202,7 @@ item has bolded text. Please see the `<paper-menu>` docs for which attributes |
*/ |
_disabledChanged: function(disabled) { |
Polymer.IronControlState._disabledChanged.apply(this, arguments); |
- if (disabled && this._active) { |
+ if (disabled && this.opened) { |
this.close(); |
} |
}, |