Skip to content

Commit

Permalink
Revert feat: position and alignment properties (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed Dec 18, 2019
1 parent 66467ef commit b25cfce
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 742 deletions.
40 changes: 0 additions & 40 deletions demo/index.html
Expand Up @@ -157,46 +157,6 @@ <h3>Backdrop and Focus Trap</h3>
</template>
</demo-snippet>

<h3>Position Target</h3>
<demo-snippet>
<template>
<vaadin-overlay id="positionOverlay" opened modeless></vaadin-overlay>
<div id="positionTarget" style="border:1px solid; width:100px; height:100px;">target</div>
<script>
const positionOverlay = document.querySelector('#positionOverlay');
const target = document.querySelector('#positionTarget');

positionOverlay.positionTarget = target;
positionOverlay.noVerticalOverlap = true;

const createToggleButton = function(prop, val1, val2) {
const btn = document.createElement('button');
btn.addEventListener('click', e => {
positionOverlay[prop] = positionOverlay[prop] === val1
? val2 : val1;
btn.textContent = `${prop}: ${positionOverlay[prop]}`;
});
btn.textContent = `${prop}: ${positionOverlay[prop]}`;
return btn;
};

positionOverlay.renderer = function(root) {
if (root.firstElementChild) {
return;
}
const div = document.createElement('div');
root.appendChild(div);
div.appendChild(createToggleButton('horizontalAlign', 'start', 'end'));
div.appendChild(createToggleButton('verticalAlign', 'top', 'bottom'));
div.appendChild(createToggleButton('noHorizontalOverlap', true, false));
div.appendChild(createToggleButton('noVerticalOverlap', true, false));

div.style.width = div.style.height = '200px';
};
</script>
</template>
</demo-snippet>

<h3>Restore Focus on Close</h3>
<demo-snippet>
<template>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -34,8 +34,7 @@
"lint:css": "stylelint *.html src/*.html demo/*.html theme/**/*.html test/*html",
"lint:html": "eslint *.html src demo test --ext .html",
"lint:js": "eslint *.js test",
"lint:polymer": "polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html",
"start": "polymer serve --port 3000 --open"
"lint:polymer": "polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html"
},
"devDependencies": {
"@vaadin/vaadin-component-dev-dependencies": "^3.0.0"
Expand Down
201 changes: 0 additions & 201 deletions src/vaadin-overlay-position-mixin.html

This file was deleted.

10 changes: 4 additions & 6 deletions src/vaadin-overlay.html
Expand Up @@ -10,7 +10,6 @@
<link rel="import" href="../../polymer/lib/utils/flattened-nodes-observer.html">
<link rel="import" href="../../vaadin-themable-mixin/vaadin-themable-mixin.html">
<link rel="import" href="vaadin-focusables-helper.html">
<link rel="import" href="vaadin-overlay-position-mixin.html">

<dom-module id="vaadin-overlay">
<template>
Expand Down Expand Up @@ -237,12 +236,9 @@
*
* @memberof Vaadin
* @mixes Vaadin.ThemableMixin
* @mixes Vaadin.Overlay.PositionMixin
* @demo demo/index.html
*/
class OverlayElement extends Vaadin.ThemableMixin(
Vaadin.Overlay.PositionMixin(
Polymer.Element)) {
class OverlayElement extends Vaadin.ThemableMixin(Polymer.Element) {

static get is() {
return 'vaadin-overlay';
Expand Down Expand Up @@ -970,9 +966,11 @@
}

customElements.define(OverlayElement.is, OverlayElement);

/**
* @namespace Vaadin
*/
window.Vaadin.OverlayElement = OverlayElement;
window.Vaadin = window.Vaadin || {};
Vaadin.OverlayElement = OverlayElement;
})();
</script>

0 comments on commit b25cfce

Please sign in to comment.