summaryrefslogtreecommitdiff
path: root/src/web/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-13 12:50:42 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-13 12:50:42 +0900
commitcbdc06ad71f73ff7a847eeca2f4f9da926a5af85 (patch)
tree75acc5c91286c2ea176b50181094171e703adb11 /src/web/app/common
parentwip (diff)
downloadsharkey-cbdc06ad71f73ff7a847eeca2f4f9da926a5af85.tar.gz
sharkey-cbdc06ad71f73ff7a847eeca2f4f9da926a5af85.tar.bz2
sharkey-cbdc06ad71f73ff7a847eeca2f4f9da926a5af85.zip
wip
Diffstat (limited to 'src/web/app/common')
-rw-r--r--src/web/app/common/views/components/reaction-picker.vue56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/web/app/common/views/components/reaction-picker.vue b/src/web/app/common/views/components/reaction-picker.vue
index b17558ba9e..0446d7b18e 100644
--- a/src/web/app/common/views/components/reaction-picker.vue
+++ b/src/web/app/common/views/components/reaction-picker.vue
@@ -32,36 +32,38 @@ export default Vue.extend({
};
},
mounted() {
- const popover = this.$refs.popover as any;
+ this.$nextTick(() => {
+ const popover = this.$refs.popover as any;
- const rect = this.source.getBoundingClientRect();
- const width = popover.offsetWidth;
- const height = popover.offsetHeight;
+ const rect = this.source.getBoundingClientRect();
+ const width = popover.offsetWidth;
+ const height = popover.offsetHeight;
- if (this.compact) {
- const x = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
- const y = rect.top + window.pageYOffset + (this.source.offsetHeight / 2);
- popover.style.left = (x - (width / 2)) + 'px';
- popover.style.top = (y - (height / 2)) + 'px';
- } else {
- const x = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
- const y = rect.top + window.pageYOffset + this.source.offsetHeight;
- popover.style.left = (x - (width / 2)) + 'px';
- popover.style.top = y + 'px';
- }
+ if (this.compact) {
+ const x = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
+ const y = rect.top + window.pageYOffset + (this.source.offsetHeight / 2);
+ popover.style.left = (x - (width / 2)) + 'px';
+ popover.style.top = (y - (height / 2)) + 'px';
+ } else {
+ const x = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
+ const y = rect.top + window.pageYOffset + this.source.offsetHeight;
+ popover.style.left = (x - (width / 2)) + 'px';
+ popover.style.top = y + 'px';
+ }
- anime({
- targets: this.$refs.backdrop,
- opacity: 1,
- duration: 100,
- easing: 'linear'
- });
+ anime({
+ targets: this.$refs.backdrop,
+ opacity: 1,
+ duration: 100,
+ easing: 'linear'
+ });
- anime({
- targets: this.$refs.popover,
- opacity: 1,
- scale: [0.5, 1],
- duration: 500
+ anime({
+ targets: this.$refs.popover,
+ opacity: 1,
+ scale: [0.5, 1],
+ duration: 500
+ });
});
},
methods: {
@@ -104,7 +106,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
- $border-color = rgba(27, 31, 35, 0.15)
+$border-color = rgba(27, 31, 35, 0.15)
.mk-reaction-picker
position initial