Skip to content

Commit

Permalink
displayShow.vue: Debounce reflowLayout (#7985)
Browse files Browse the repository at this point in the history
It was reflowing the layout multiple times per loaded season.
I've debounced the method call to 1000 ms. This will improve loading times with many seasons loaded.
  • Loading branch information
p0psicles authored Apr 18, 2020
1 parent 8636dc4 commit 90e3cba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions themes-default/slim/src/components/display-show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@
</template>

<script>
import debounce from 'lodash/debounce';
import formatDate from 'date-fns/format';
import parseISO from 'date-fns/parseISO';
import { mapState, mapGetters, mapActions } from 'vuex';
Expand Down Expand Up @@ -808,14 +809,14 @@ export default {
* Attaches IMDB tooltip,
* Moves summary and checkbox controls backgrounds
*/
reflowLayout() {
reflowLayout: debounce(function() {
console.debug('Reflowing layout');
this.$nextTick(() => {
this.movecheckboxControlsBackground();
});
addQTip(); // eslint-disable-line no-undef
},
}, 1000),
/**
* Adjust the checkbox controls (episode filter) background position
*/
Expand Down
Loading

0 comments on commit 90e3cba

Please sign in to comment.