Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
スクロールが必要ないピン留めのときコンテクストメニューが隠れるのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jun 24, 2019
1 parent da81dbb commit 59c1061
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/components/Main/Modal/BaseCommonModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default {

<style lang="sass">
.common-modal
display: flex
flex-direction: column
background: $background-color
border-radius: $modal-border-radius
max-width: 60rem
Expand All @@ -71,10 +73,11 @@ export default {
.common-modal[data-is-tiny="true"]
max-width: 25rem
.common-modal[data-is-scroll="true"]
display: flex
flex-direction: column
.common-modal-content
overflow-y: auto
overflow-y: scroll
.common-modal:not([data-is-scroll])
.common-modal-content
overflow-y: visible
.common-modal-header-wrap
display: flex
align-items: center
Expand Down
18 changes: 15 additions & 3 deletions src/components/Main/Modal/PinnedModal.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template lang="pug">
base-common-modal(title="PINNED" small scroll)
base-common-modal(title="PINNED" small :scroll="isScrollable")
icon-pin(color="var(--primary-color-on-bg)" slot="header-icon" size="24")
.message-item
message-element(:model="data")
.message-item(ref="message")
message-element(:model="data" @rendered="messageRendered")
</template>

<script>
Expand All @@ -18,8 +18,20 @@ export default {
BaseCommonModal,
IconPin
},
data() {
return {
isScrollable: false
}
},
computed: {
...mapState('modal', ['data'])
},
methods: {
messageRendered() {
this.isScrollable =
this.$refs.message.clientHeight >
this.$refs.message.parentElement.clientHeight
}
}
}
</script>
Expand Down

0 comments on commit 59c1061

Please sign in to comment.