投稿のURLプレビューポップアップを改良 (#6226)

* URLプレビューポップアップを改良

- タッチデバイスでは表示しないように
- 幅をレスポンシブに

* Use maxTouchPoints to detect touch device

* fix
This commit is contained in:
tamaina
2020-04-14 00:00:52 +09:00
committed by GitHub
parent 916512fd47
commit 96eab7e12b
4 changed files with 11 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ export default Vue.extend({
mounted() {
const rect = this.source.getBoundingClientRect();
const x = ((rect.left + (this.source.offsetWidth / 2)) - (300 / 2)) + window.pageXOffset;
const x = Math.max((rect.left + (this.source.offsetWidth / 2)) - (300 / 2), 6) + window.pageXOffset;
const y = rect.top + this.source.offsetHeight + window.pageYOffset;
this.top = y;
@@ -50,6 +50,7 @@ export default Vue.extend({
position: absolute;
z-index: 11000;
width: 500px;
max-width: calc(90vw - 12px);
overflow: hidden;
pointer-events: none;
}