mirror of
https://github.com/wekan/wekan.git
synced 2026-11-07 11:02:33 -05:00
Use the available browser width and default card titles to a compact single line with an escaped native tooltip. Add a per-user wrap preference that persists locally. Cover default, toggled and user-isolated preference behavior plus the rendered browser layout. Thanks to rmb82 and xet7 ! Fixes #6632,
24 lines
593 B
JavaScript
24 lines
593 B
JavaScript
'use strict';
|
|
|
|
const STORAGE_PREFIX = 'wekan-table-card-title-wrap:';
|
|
|
|
function tableViewTitleStorageKey(userId) {
|
|
return `${STORAGE_PREFIX}${userId || 'anonymous'}`;
|
|
}
|
|
|
|
function readTableViewTitleWrap(storage, userId) {
|
|
if (!storage) return false;
|
|
return storage.getItem(tableViewTitleStorageKey(userId)) === 'true';
|
|
}
|
|
|
|
function writeTableViewTitleWrap(storage, userId, wrap) {
|
|
if (!storage) return;
|
|
storage.setItem(tableViewTitleStorageKey(userId), wrap ? 'true' : 'false');
|
|
}
|
|
|
|
module.exports = {
|
|
tableViewTitleStorageKey,
|
|
readTableViewTitleWrap,
|
|
writeTableViewTitleWrap,
|
|
};
|