layout: allow disable

old-stable24
Varun Patil 2022-10-17 16:55:58 -07:00
parent c9eb878330
commit 88e89c88e0
3 changed files with 5 additions and 2 deletions

View File

@ -34,7 +34,7 @@
<NcCheckboxRadioSwitch :checked.sync="config_squareThumbs"
type="switch">
{{ t('memories', 'Square photos') }}
{{ t('memories', 'Square grid mode') }}
</NcCheckboxRadioSwitch>
<button @click="updateAll()">

View File

@ -725,6 +725,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
rowHeight: this.rowHeight,
squareMode: this.squareMode,
numCols: this.numCols,
allowBreakout: (window.innerWidth < 768) && !this.config_squareThumbs,
seed: dayId,
});

View File

@ -13,6 +13,7 @@ export function getLayout(
rowHeight: number,
squareMode: boolean,
numCols: number,
allowBreakout: boolean,
seed: number,
}
): {
@ -71,7 +72,8 @@ export function getLayout(
// Check if previous row has something used
// or something beside this is used
// We don't do these one after another
if ((row > 0 && matrix[row-1].some(v => v & FLAG_USED)) ||
if (!opts.allowBreakout ||
(row > 0 && matrix[row-1].some(v => v & FLAG_USED)) ||
(col > 0 && matrix[row][col-1] & FLAG_USED)
) {
photoId++; col++; continue;