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

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

Issue 2074813002: Roll Polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromium.patch Created 4 years, 6 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-tabs/paper-tabs-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-tabs/paper-tabs-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-tabs/paper-tabs-extracted.js
index c62ca49ae69f3470d65a0b1629abba7aee349068..9c20f8db600840bd9cb5b39fcf415b508d25b2be 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-tabs/paper-tabs-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-tabs/paper-tabs-extracted.js
@@ -43,6 +43,15 @@ Polymer({
},
/**
+ * If true, tabs expand to fit their container. This currently only applies when
+ * scrollable is true.
+ */
+ fitContainer: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
* If true, dragging on the tabs to scroll is disabled.
*/
disableDrag: {
@@ -171,8 +180,8 @@ Polymer({
return '';
},
- _computeTabsContentClass: function(scrollable) {
- return scrollable ? 'scrollable' : 'horizontal';
+ _computeTabsContentClass: function(scrollable, fitContainer) {
+ return scrollable ? 'scrollable' + (fitContainer ? ' fit-container' : '') : ' fit-container';
},
_computeSelectionBarClass: function(noBar, alignBottom) {
@@ -203,6 +212,7 @@ Polymer({
_onIronDeselect: function(event) {
this.debounce('tab-changed', function() {
this._tabChanged(null, this._previousTab);
+ this._previousTab = null;
// See polymer/polymer#1305
}, 1);
},
@@ -325,6 +335,9 @@ Polymer({
_tabChanged: function(tab, old) {
if (!tab) {
+ // Remove the bar without animation.
+ this.$.selectionBar.classList.remove('expand');
+ this.$.selectionBar.classList.remove('contract');
this._positionBar(0, 0);
return;
}
@@ -340,7 +353,9 @@ Polymer({
};
if (this.noSlide || old == null) {
- // position bar directly without animation
+ // Position the bar without animation.
+ this.$.selectionBar.classList.remove('expand');
+ this.$.selectionBar.classList.remove('contract');
this._positionBar(this._pos.width, this._pos.left);
return;
}
@@ -395,7 +410,7 @@ Polymer({
this._width = width;
this._left = left;
this.transform(
- 'translate3d(' + left + '%, 0, 0) scaleX(' + (width / 100) + ')',
+ 'translateX(' + left + '%) scaleX(' + (width / 100) + ')',
this.$.selectionBar);
},

Powered by Google App Engine
This is Rietveld 408576698