Skip to content

Open source personal finance application

fix TrnForm

ilkomefe5c1cbadf9d
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index fcf283a8..b78a0ff7 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -66,38 +66,42 @@ export default {
observer.observe(el)
}
+ function init () {
+ if (!sliderObj.value) {
+ setTimeout(() => {
+ sliderObj.value = new Swiper(slider.value, {
+ init: false,
+ observer: true,
+ observeParents: true,
+ slidesPerView: 1,
+ autoHeight: true,
+ initialSlide: 1,
+ noSwipingClass: 'trnFormNoSwiping',
+ shortSwipes: false,
+ longSwipesRatio: 0.1,
+ longSwipesMs: 60,
+ pagination: {
+ el: '.trnForm__pagination',
+ clickable: true
+ }
+ })
+ setTrnFormHeight()
+ sliderObj.value.init()
+ initTouchModal({
+ ...toRefs(wrappers),
+ onClose: () => store.dispatch('trnForm/closeTrnForm')
+ })
+ }, 10)
+ }
+ }
+
/**
* isShow
*/
const { isShow } = toRefs(props)
watch(isShow, (value) => {
if (value) {
- setTimeout(() => {
- if (!sliderObj.value) {
- sliderObj.value = new Swiper(slider.value, {
- init: false,
- observer: true,
- observeParents: true,
- slidesPerView: 1,
- autoHeight: true,
- initialSlide: 1,
- noSwipingClass: 'trnFormNoSwiping',
- shortSwipes: false,
- longSwipesRatio: 0.1,
- longSwipesMs: 60,
- pagination: {
- el: '.trnForm__pagination',
- clickable: true
- }
- })
- setTrnFormHeight()
- sliderObj.value.init()
- initTouchModal({
- ...toRefs(wrappers),
- onClose: () => store.dispatch('trnForm/closeTrnForm')
- })
- }
- }, 10)
+ init()
}
else {
if (sliderObj.value) {
diff --git a/components/trnForm/modal/TrnFormModal.vue b/components/trnForm/modal/TrnFormModal.vue
index fa94180d..ca3baa6f 100644
--- a/components/trnForm/modal/TrnFormModal.vue
+++ b/components/trnForm/modal/TrnFormModal.vue
@@ -181,6 +181,7 @@ Portal(to="modal")
.trnFormModal
z-index 100
position absolute
+ width 100%
@media $media-laptop
position absolute
@@ -206,7 +207,7 @@ Portal(to="modal")
anim()
@media $media-laptop
- display none
+ opacity .1
&__wrap
overflow hidden
diff --git a/components/trnForm/styles/trnForm.styl b/components/trnForm/styles/trnForm.styl
index b1c70f95..1042c8cd 100644
--- a/components/trnForm/styles/trnForm.styl
+++ b/components/trnForm/styles/trnForm.styl
@@ -1,5 +1,5 @@
.trnForm
- @media $media-phone
+ @media (max-width 999px)
overflow hidden
z-index 10
position fixed
@@ -21,7 +21,7 @@
height 100%
background var(--c-bg-14)
- @media $media-phone
+ @media (max-width 999px)
position fixed
right 0
bottom 0
@@ -41,9 +41,10 @@
margin 0 auto
background var(--c-bg-4)
- @media $media-phone
+ @media (max-width 999px)
+ max-width 500px
max-height calc(100vh - 24px)
- margin-left auto
+ margin 0 auto
@media $media-laptop
align-self center