Fix scrolling through the download dropdown (#2426)
* Fix scrolling through the download dropdown * Fix lining issue
This commit is contained in:
		
							parent
							
								
									34bbba55da
								
							
						
					
					
						commit
						01cfbe7b1e
					
				| 
						 | 
				
			
			@ -300,6 +300,18 @@ export default Vue.extend({
 | 
			
		|||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      this.$watch('$refs.downloadButton.dropdownShown', (dropdownShown) => {
 | 
			
		||||
        this.$parent.infoAreaSticky = !dropdownShown
 | 
			
		||||
 | 
			
		||||
        if (dropdownShown && window.innerWidth >= 901) {
 | 
			
		||||
          // adds a slight delay so we know that the dropdown has shown up
 | 
			
		||||
          // and won't mess up our scrolling
 | 
			
		||||
          Promise.resolve().then(() => {
 | 
			
		||||
            this.$parent.$refs.infoArea.scrollIntoView()
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,6 +96,7 @@
 | 
			
		|||
        />
 | 
			
		||||
        <ft-icon-button
 | 
			
		||||
          v-if="!isUpcoming && downloadLinks.length > 0"
 | 
			
		||||
          ref="downloadButton"
 | 
			
		||||
          :title="$t('Video.Download Video')"
 | 
			
		||||
          class="option"
 | 
			
		||||
          theme="secondary"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,7 +79,8 @@ export default Vue.extend({
 | 
			
		|||
      timestamp: null,
 | 
			
		||||
      playNextTimeout: null,
 | 
			
		||||
      playNextCountDownIntervalId: null,
 | 
			
		||||
      pictureInPictureButtonInverval: null
 | 
			
		||||
      pictureInPictureButtonInverval: null,
 | 
			
		||||
      infoAreaSticky: true
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -74,7 +74,11 @@
 | 
			
		|||
    grid-area: info
 | 
			
		||||
    position: relative
 | 
			
		||||
 | 
			
		||||
    @media only screen and (min-width: 901px)
 | 
			
		||||
  @media only screen and (min-width: 901px)
 | 
			
		||||
    .infoArea
 | 
			
		||||
      scroll-margin-top: 76px
 | 
			
		||||
 | 
			
		||||
    .infoAreaSticky
 | 
			
		||||
      position: sticky
 | 
			
		||||
      top: 76px
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -74,7 +74,9 @@
 | 
			
		|||
    />
 | 
			
		||||
    <div
 | 
			
		||||
      v-if="(isFamilyFriendly || !showFamilyFriendlyOnly)"
 | 
			
		||||
      ref="infoArea"
 | 
			
		||||
      class="infoArea"
 | 
			
		||||
      :class="{ infoAreaSticky }"
 | 
			
		||||
    >
 | 
			
		||||
      <watch-video-info
 | 
			
		||||
        v-if="!isLoading"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue