diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-15 11:32:41 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-15 11:32:41 +0100 |
commit | 3984f559e4c0a7d38cd093da08fec0c209eaa569 (patch) | |
tree | 3531d5c6c1d85efba171c8dec233b52d1b3e05bf /src/components | |
parent | ef3222e8008e09d16867ea72da067bde12825c27 (diff) |
Repair and fix REV and repair on import
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ContactDetails.vue | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue index b740e0d5..38533a01 100644 --- a/src/components/ContactDetails.vue +++ b/src/components/ContactDetails.vue @@ -459,11 +459,13 @@ export default { // scroll to selected contact if any let list = document.getElementById('contacts-list') let item = document.querySelector('#' + btoa(contact.key).slice(0, -2)) - let isAbove = list.scrollTop > item.offsetTop - let isUnder = item.offsetTop + item.offsetHeight > list.scrollTop + list.offsetHeight - // check if contact outside visible list area - if (item && (isAbove || isUnder)) { - list.scrollTo(0, item.offsetTop - item.offsetHeight / 2) + if (item) { + let isAbove = list.scrollTop > item.offsetTop + let isUnder = item.offsetTop + item.offsetHeight > list.scrollTop + list.offsetHeight + // check if contact outside visible list area + if (isAbove || isUnder) { + list.scrollTo(0, item.offsetTop - item.offsetHeight / 2) + } } } }, |