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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js

Issue 1162963002: Revert "Rename polymer and cr_elements v0_8 to v1_0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/iron-collapse/iron-collapse-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js
deleted file mode 100644
index f85b985568d07eaea9535c61aa7d7f9b3844aca6..0000000000000000000000000000000000000000
--- a/third_party/polymer/v1_0/components-chromium/iron-collapse/iron-collapse-extracted.js
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
- Polymer({
-
- is: 'iron-collapse',
-
- properties: {
-
- /**
- * If true, the orientation is horizontal; otherwise is vertical.
- *
- * @attribute horizontal
- */
- horizontal: {
- type: Boolean,
- value: false,
- observer: '_horizontalChanged'
- },
-
- /**
- * 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'
- }
-
- },
-
- hostAttributes: {
- role: 'group',
- 'aria-expanded': 'false',
- tabindex: 0
- },
-
- listeners: {
- transitionend: '_transitionEnd'
- },
-
- ready: function() {
- // Avoid transition at the beginning e.g. page loads and enable
- // transitions only after the element is rendered and ready.
- this._enableTransition = true;
- },
-
- /**
- * Toggle the opened state.
- *
- * @method toggle
- */
- toggle: function() {
- this.opened = !this.opened;
- },
-
- show: function() {
- this.toggleClass('iron-collapse-closed', false);
- this.updateSize('auto', false);
- var s = this._calcSize();
- this.updateSize('0px', false);
- // force layout to ensure transition will go
- this.offsetHeight;
- this.updateSize(s, true);
- },
-
- hide: function() {
- this.toggleClass('iron-collapse-opened', false);
- this.updateSize(this._calcSize(), false);
- // force layout to ensure transition will go
- this.offsetHeight;
- this.updateSize('0px', true);
- },
-
- updateSize: function(size, animated) {
- this.enableTransition(animated);
- var s = this.style;
- var nochange = s[this.dimension] === size;
- s[this.dimension] = size;
- if (animated && nochange) {
- this._transitionEnd();
- }
- },
-
- enableTransition: function(enabled) {
- this.style.transitionDuration = (enabled && this._enableTransition) ? '' : '0s';
- },
-
- _horizontalChanged: function() {
- this.dimension = this.horizontal ? 'width' : 'height';
- this.style.transitionProperty = this.dimension;
- },
-
- _openedChanged: function() {
- this[this.opened ? 'show' : 'hide']();
- this.setAttribute('aria-expanded', this.opened ? 'true' : 'false');
-
- },
-
- _transitionEnd: function() {
- if (this.opened) {
- this.updateSize('auto', false);
- }
- this.toggleClass('iron-collapse-closed', !this.opened);
- this.toggleClass('iron-collapse-opened', this.opened);
- this.enableTransition(false);
- },
-
- _calcSize: function() {
- return this.getBoundingClientRect()[this.dimension] + 'px';
- },
-
-
- });
-

Powered by Google App Engine
This is Rietveld 408576698