Better title adjust logic
This commit is contained in:
parent
344fbe6bcd
commit
18628b821e
1 changed files with 10 additions and 5 deletions
|
@ -257,11 +257,6 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if (this.showNav) return; // TODO: トランジション中も false になるので、これだけでは不十分
|
|
||||||
this.$refs.title.style.left = (this.$refs.main.getBoundingClientRect().left - this.$refs.nav.offsetWidth) + 'px';
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/33891709/when-flexbox-items-wrap-in-column-mode-container-does-not-grow-its-width
|
// https://stackoverflow.com/questions/33891709/when-flexbox-items-wrap-in-column-mode-container-does-not-grow-its-width
|
||||||
if (this.enableWidgets) {
|
if (this.enableWidgets) {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
@ -273,6 +268,16 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
const adjustTitlePosition = () => {
|
||||||
|
this.$refs.title.style.left = (this.$refs.main.getBoundingClientRect().left - this.$refs.nav.offsetWidth) + 'px';
|
||||||
|
};
|
||||||
|
|
||||||
|
adjustTitlePosition();
|
||||||
|
|
||||||
|
window.addEventListener('resize', adjustTitlePosition);
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
help() {
|
help() {
|
||||||
this.$router.push('/docs/keyboard-shortcut');
|
this.$router.push('/docs/keyboard-shortcut');
|
||||||
|
|
Loading…
Reference in a new issue