Commit 16b85b67 authored by Wolfgang's avatar Wolfgang

Fix issue with whitespace after pb-popover

parent 3f31ef78
......@@ -25,10 +25,17 @@
<template>
<main>
<div>
<p><pb-popover>Lorem<span slot="alternate">tooltip popover</span></pb-popover> ipsum dolor sit amet,
consetetur <pb-popover persistent>sadipscing<span slot="alternate">persistent dialog popover</span></pb-popover> elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
</p>
<p>Lorem <pb-popover>ipsum dolor<span slot="alternate">At vero eos et accusam et justo duo dolores<br>
et ea rebum.</span></pb-popover> sit amet, consetetur sadipscing elitr,<br>
sed diam nonumy eirmod tempor invidunt ut labore et dolore<br>
magna aliquyam erat, sed diam voluptua. At vero eos et accusam<br>
et justo duo dolores et ea <pb-popover>rebum<span slot="alternate">Popup</span></pb-popover>. Stet clita kasd gubergren,<br>
no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem<br>
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam<br>
nonumy eirmod <pb-popover persistent>tempor invidunt<br> ut labore<span slot="alternate">This is a persistent tooltip</span><span slot="title">The Title</span></pb-popover> et dolore magna aliquyam<br>
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores<br>
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est<br>
Lorem ipsum dolor sit amet.</p>
</div>
</main>
</template>
......
......@@ -5,17 +5,19 @@
<template>
<style>
:host {
display: inline-block;
display: inline;
}
a {
text-decoration: inherit;
color: inherit;
cursor: text;
}
a.persistent {
cursor: pointer;
}
</style>
<a href="#" id="link" on-click="_open"><slot></slot></a>
<template is="dom-if" if="[[_isPersistent()]]">
<paper-dialog id="dialog" dynamic-align no-overlap horizontal-align="left" vertical-align="top">
<a href="#" id="link" on-click="_open" class$="[[_getClass()]]"><slot></slot></a><template is="dom-if" if="[[_isPersistent()]]"><paper-dialog id="dialog" dynamic-align no-overlap horizontal-align="left" vertical-align="top">
<h2><slot name="title"></slot></h2>
<paper-dialog-scrollable>
<slot name="alternate"></slot>
......@@ -24,16 +26,9 @@
<paper-button dialog-confirm="dialog-confirm" autofocus="autofocus">
Close
</paper-button>
</div>
</paper-dialog>
</template>
<template is="dom-if" if="[[!_isPersistent()]]">
<paper-tooltip for="link" position="bottom" fit-to-visible-bounds="fit-to-visible-bounds">
</div></paper-dialog></template><template is="dom-if" if="[[!_isPersistent()]]"><paper-tooltip for="link" position="bottom" fit-to-visible-bounds="fit-to-visible-bounds">
<slot name="alternate"></slot>
</paper-tooltip>
</template>
</template>
</paper-tooltip></template></template>
<script>
/**
......@@ -67,6 +62,10 @@
return this.persistent;
}
_getClass() {
return this.persistent ? 'persistent' : '';
}
_open(ev) {
ev.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment