update polymer components

This commit is contained in:
Luke Pulverenti 2015-10-28 16:56:25 -04:00
parent 0320ad7256
commit 3c08769c6c
29 changed files with 961 additions and 844 deletions

View file

@ -1,12 +1,10 @@
{
"name": "iron-fit-behavior",
"version": "1.0.3",
"version": "1.0.4",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Fits an element inside another element",
"private": true,
"main": [
"iron-fit-behavior.html"
],
"main": "iron-fit-behavior.html",
"keywords": [
"web-components",
"polymer",
@ -30,11 +28,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-fit-behavior",
"_release": "1.0.3",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "df9fd83577ea6ebd98f5cad8333daa73dd0f34ba"
"tag": "v1.0.4",
"commit": "db76c6b9f3df86ee6dfc2339975313ac2efc6474"
},
"_source": "git://github.com/PolymerElements/iron-fit-behavior.git",
"_target": "^1.0.0",

View file

@ -1,12 +1,10 @@
{
"name": "iron-fit-behavior",
"version": "1.0.3",
"version": "1.0.4",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Fits an element inside another element",
"private": true,
"main": [
"iron-fit-behavior.html"
],
"main": "iron-fit-behavior.html",
"keywords": [
"web-components",
"polymer",

View file

@ -207,6 +207,10 @@ CSS properties | Action
if (!this._fitInfo.positionedBy.horizontally) {
this.style.left = '0px';
}
if (!this._fitInfo.positionedBy.vertically || !this._fitInfo.positionedBy.horizontally) {
// need position:fixed to properly size the element
this.style.position = 'fixed';
}
// need border-box for margin/padding
this.sizingTarget.style.boxSizing = 'border-box';
// constrain the width and height if not already set

View file

@ -149,6 +149,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="offscreen-container">
<template>
<div style="position: fixed; top: -1px; left: 0;">
<test-fit auto-fit-on-attach class="el sized-x">
<div>
Sized (x), auto center/center, container is offscreen
</div>
</test-fit>
</div>
</template>
</test-fixture>
<template id="ipsum">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</template>
@ -231,6 +243,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.isTrue(rect.height <= window.innerHeight, 'height is less than or equal to viewport height');
});
test('scrolling element with offscreen container is constrained to viewport height', function() {
var container = fixture('offscreen-container');
var el = Polymer.dom(container).querySelector('.el')
makeScrolling(el);
el.refit();
var rect = el.getBoundingClientRect();
assert.isTrue(rect.height <= window.innerHeight, 'height is less than or equal to viewport height');
});
test('scrolling element with max-height is centered in viewport', function() {
var el = fixture('sized-x');
el.classList.add('with-max-height');