File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535 },
3636 "dependencies" : {
3737 "axios" : " ^0.18.0" ,
38+ "debounce" : " ^1.2.0" ,
3839 "mime-types" : " ^2.1.22" ,
3940 "nextcloud-server" : " ^0.15.9" ,
40- "nextcloud-vue" : " ^0.8 .0" ,
41+ "nextcloud-vue" : " ^0.9 .0" ,
4142 "vue" : " ^2.6.8" ,
4243 "vue-async-computed" : " ^3.6.1"
4344 },
Original file line number Diff line number Diff line change 3434import mime from ' Mixins/Mime'
3535import axios from ' axios'
3636import Vue from ' vue'
37+ import debounce from ' debounce'
3738import AsyncComputed from ' vue-async-computed'
3839
3940Vue .use (AsyncComputed)
@@ -51,7 +52,13 @@ export default {
5152 return this .getBase64FromImage ()
5253 }
5354 },
55+ mounted () {
56+ window .addEventListener (' resize' , debounce (() => {
57+ this .updateImgSize ()
58+ }, 100 ))
59+ },
5460 methods: {
61+ // Updates the dimensions of the modal
5562 updateImgSize () {
5663 const naturalHeight = this .$el .naturalHeight
5764 const naturalWidth = this .$el .naturalWidth
@@ -64,6 +71,7 @@ export default {
6471
6572 this .doneLoading ()
6673 },
74+
6775 /**
6876 * Manually retrieve the path and return its base64
6977 *
Original file line number Diff line number Diff line change 4343</template >
4444
4545<script >
46+ import debounce from ' debounce'
4647import mime from ' Mixins/Mime'
4748
4849export default {
@@ -67,18 +68,28 @@ export default {
6768 }
6869 }
6970 },
71+ mounted () {
72+ window .addEventListener (' resize' , debounce (() => {
73+ this .updateVideoSize ()
74+ }, 100 ))
75+ },
7076 methods: {
77+ // Updates the dimensions of the modal
7178 updateVideoSize () {
7279 const videoHeight = this .$el .videoHeight
7380 const videoWidth = this .$el .videoWidth
7481 this .updateHeightWidth (videoHeight, videoWidth)
7582 },
83+
84+ // Show/hide video controls
7685 showControls () {
7786 this .visibleControls = true
7887 },
7988 hideControls () {
8089 this .visibleControls = false
8190 },
91+
92+ // Toggle play/pause
8293 playPause () {
8394 if (this .$el .paused ) {
8495 this .$el .play ()
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default {
6767 const modalContainer = this . $parent . $el . querySelector ( '#modal-wrapper' )
6868 if ( modalContainer ) {
6969 // ! modal container have maxHeight:80% AND maxWidth: 900px
70- const parentHeight = Math . round ( modalContainer . clientHeight * 0.8 )
70+ const parentHeight = Math . round ( modalContainer . clientHeight * 0.8 ) - 50 // minus header
7171 const parentWidth = modalContainer . clientWidth > 900
7272 ? 900
7373 : modalContainer . clientWidth
Original file line number Diff line number Diff line change 4141 :key =" previousFile.path"
4242 :mime =" previousFile.mime"
4343 :path =" previousFile.path"
44- class =" hidden-visually"
44+ class =" hidden-visually file-view "
4545 @error =" previousFailed" />
4646 <error
4747 v-else
5656 :mime =" currentFile.mime"
5757 :path =" currentFile.path"
5858 :active =" true"
59+ class =" file-view"
5960 @loaded =" doneLoading"
6061 @error =" currentFailed" />
6162 <error
7071 :key =" nextFile.path"
7172 :mime =" nextFile.mime"
7273 :path =" nextFile.path"
73- class =" hidden-visually"
74+ class =" hidden-visually file-view "
7475 @error =" nextFailed" />
7576 <error
7677 v-else
@@ -439,4 +440,9 @@ export default {
439440.icon-share-white-forced {
440441 background-image : url (' ~Assets/share-white.svg' );
441442}
443+
444+ .file-view {
445+ transition : height 100ms ease ,
446+ width 100ms ease ;
447+ }
442448 </style >
You can’t perform that action at this time.
0 commit comments