Revert isMobile to func

old-stable24
Varun Patil 2022-10-20 16:15:18 -07:00
parent 13388c8afc
commit d206d731bb
1 changed files with 10 additions and 2 deletions

View File

@ -222,6 +222,14 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
this.loading += delta; this.loading += delta;
} }
isMobile() {
return window.innerWidth <= 768;
}
allowBreakout() {
return this.isMobile() && !this.config_squareThumbs;
}
/** Create new state */ /** Create new state */
async createState() { async createState() {
// Wait for one tick before doing anything // Wait for one tick before doing anything
@ -295,7 +303,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
const recycler = this.$refs.recycler as any; const recycler = this.$refs.recycler as any;
recycler.$el.style.height = (height - tmHeight - 4) + 'px'; recycler.$el.style.height = (height - tmHeight - 4) + 'px';
if (window.innerWidth <= 768) { if (this.isMobile()) {
// Mobile // Mobile
this.numCols = MOBILE_NUM_COLS; this.numCols = MOBILE_NUM_COLS;
this.rowHeight = Math.floor(this.rowWidth / this.numCols); this.rowHeight = Math.floor(this.rowWidth / this.numCols);
@ -767,7 +775,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
rowHeight: this.rowHeight, rowHeight: this.rowHeight,
squareMode: this.squareMode, squareMode: this.squareMode,
numCols: this.numCols, numCols: this.numCols,
allowBreakout: (window.innerWidth < 768) && !this.config_squareThumbs, allowBreakout: this.allowBreakout(),
seed: dayId, seed: dayId,
}); });