Polyfills sticky position within a watcher

This commit is contained in:
Filipa Lacerda 2018-11-06 13:23:52 +00:00
parent 00c7d78d49
commit 26e88b10ad
No known key found for this signature in database
GPG Key ID: 569522463C8A0CC7
1 changed files with 8 additions and 11 deletions

View File

@ -100,6 +100,14 @@ export default {
if (_.isEmpty(oldVal) && !_.isEmpty(newVal.pipeline)) {
this.fetchStages();
}
if (newVal.archived) {
this.$nextTick(() => {
if (this.$refs.sticky) {
polyfillSticky(this.$refs.sticky);
}
});
}
},
},
created() {
@ -117,24 +125,13 @@ export default {
window.addEventListener('resize', this.onResize);
window.addEventListener('scroll', this.updateScroll);
},
mounted() {
this.updateSidebar();
},
updated() {
this.$nextTick(() => {
if (this.$refs.sticky) {
polyfillSticky(this.$refs.sticky);
}
});
},
destroyed() {
window.removeEventListener('resize', this.onResize);
window.removeEventListener('scroll', this.updateScroll);
},
methods: {
...mapActions([
'setJobEndpoint',