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

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

Issue 1468623004: Update Polymer from 1.2.1 -> 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@travis-yml
Patch Set: local-state.html Created 5 years, 1 month 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 eb50ecc0abaae2ba6bc10617e92522668f4eba28..816cfdd1861bb2fb58fc3b8ad723c92386cdb9d6 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
@@ -1,131 +1,127 @@
(function() {
-
- Polymer({
-
- is: 'paper-submenu',
-
- properties: {
- /**
- * Fired when the submenu is opened.
- *
- * @event paper-submenu-open
- */
-
- /**
- * Fired when the submenu is closed.
- *
- * @event paper-submenu-close
- */
-
- /**
- * Set opened to true to show the collapse element and to false to hide it.
- *
- * @attribute opened
- */
- opened: {
- type: Boolean,
- value: false,
- notify: true,
- observer: '_openedChanged'
- }
- },
-
- behaviors: [
- Polymer.IronControlState
- ],
-
- get __parent() {
- return Polymer.dom(this).parentNode;
- },
-
- get __trigger() {
- return Polymer.dom(this.$.trigger).getDistributedNodes()[0];
- },
-
- attached: function() {
- this.listen(this.__parent, 'iron-activate', '_onParentIronActivate');
- },
-
- dettached: function() {
- this.unlisten(this.__parent, 'iron-activate', '_onParentIronActivate');
- },
-
- /**
- * Expand the submenu content.
- */
- open: function() {
- if (this.disabled)
- return;
- this.$.collapse.show();
- this._active = true;
- this.__trigger.classList.add('iron-selected');
- },
-
- /**
- * Collapse the submenu content.
- */
- close: function() {
- this.$.collapse.hide();
- this._active = false;
- this.__trigger.classList.remove('iron-selected');
- },
-
- /**
- * A handler that is called when the trigger is tapped.
- */
- _onTap: function() {
- if (this.disabled)
- return;
- this.$.collapse.toggle();
- },
-
- /**
- * Toggles the submenu content when the trigger is tapped.
- */
- _openedChanged: function(opened, oldOpened) {
- if (opened) {
- this.fire('paper-submenu-open');
- } else if (oldOpened != null) {
- this.fire('paper-submenu-close');
- }
- },
-
- /**
- * A handler that is called when `iron-activate` is fired.
- *
- * @param {CustomEvent} event An `iron-activate` event.
- */
- _onParentIronActivate: function(event) {
- if (Polymer.Gestures.findOriginalTarget(event) !== this.__parent) {
- return;
- }
-
- // The activated item can either be this submenu, in which case it
- // should be expanded, or any of the other sibling submenus, in which
- // case this submenu should be collapsed.
- if (event.detail.item == this) {
- if (this._active)
- return;
- this.open();
- } else {
- this.close();
- }
- },
-
- /**
- * If the dropdown is open when disabled becomes true, close the
- * dropdown.
- *
- * @param {boolean} disabled True if disabled, otherwise false.
- */
- _disabledChanged: function(disabled) {
- Polymer.IronControlState._disabledChanged.apply(this, arguments);
- if (disabled && this._active) {
- this.close();
-
- }
- }
-
- });
-
-})();
+ Polymer({
+ is: 'paper-submenu',
+
+ properties: {
+ /**
+ * Fired when the submenu is opened.
+ *
+ * @event paper-submenu-open
+ */
+
+ /**
+ * Fired when the submenu is closed.
+ *
+ * @event paper-submenu-close
+ */
+
+ /**
+ * Set opened to true to show the collapse element and to false to hide it.
+ *
+ * @attribute opened
+ */
+ opened: {
+ type: Boolean,
+ value: false,
+ notify: true,
+ observer: '_openedChanged'
+ }
+ },
+
+ behaviors: [
+ Polymer.IronControlState
+ ],
+
+ get __parent() {
+ return Polymer.dom(this).parentNode;
+ },
+
+ get __trigger() {
+ return Polymer.dom(this.$.trigger).getDistributedNodes()[0];
+ },
+
+ attached: function() {
+ this.listen(this.__parent, 'iron-activate', '_onParentIronActivate');
+ },
+
+ dettached: function() {
+ this.unlisten(this.__parent, 'iron-activate', '_onParentIronActivate');
+ },
+
+ /**
+ * Expand the submenu content.
+ */
+ open: function() {
+ if (this.disabled)
+ return;
+ this.$.collapse.show();
+ this._active = true;
+ this.__trigger.classList.add('iron-selected');
+ },
+
+ /**
+ * Collapse the submenu content.
+ */
+ close: function() {
+ this.$.collapse.hide();
+ this._active = false;
+ this.__trigger.classList.remove('iron-selected');
+ },
+
+ /**
+ * A handler that is called when the trigger is tapped.
+ */
+ _onTap: function() {
+ if (this.disabled)
+ return;
+ this.$.collapse.toggle();
+ },
+
+ /**
+ * Toggles the submenu content when the trigger is tapped.
+ */
+ _openedChanged: function(opened, oldOpened) {
+ if (opened) {
+ this.fire('paper-submenu-open');
+ } else if (oldOpened != null) {
+ this.fire('paper-submenu-close');
+ }
+ },
+
+ /**
+ * A handler that is called when `iron-activate` is fired.
+ *
+ * @param {CustomEvent} event An `iron-activate` event.
+ */
+ _onParentIronActivate: function(event) {
+ if (Polymer.Gestures.findOriginalTarget(event) !== this.__parent) {
+ return;
+ }
+
+ // The activated item can either be this submenu, in which case it
+ // should be expanded, or any of the other sibling submenus, in which
+ // case this submenu should be collapsed.
+ if (event.detail.item == this) {
+ if (this._active)
+ return;
+ this.open();
+ } else {
+ this.close();
+ }
+ },
+
+ /**
+ * If the dropdown is open when disabled becomes true, close the
+ * dropdown.
+ *
+ * @param {boolean} disabled True if disabled, otherwise false.
+ */
+ _disabledChanged: function(disabled) {
+ Polymer.IronControlState._disabledChanged.apply(this, arguments);
+ if (disabled && this._active) {
+ this.close();
+
+ }
+ }
+ });
+ })();

Powered by Google App Engine
This is Rietveld 408576698