Files
wekan/client/lib/sortableOptions.js
Lauri Ojansivu a0f2550e5d Large board: set jQuery UI sortable options only when they changed.
The card, list and swimlane sortables re-applied handle, items and disabled
from autoruns. jQuery UI does not skip an unchanged value: setting handle
re-tags every card of the list, about k^2 work for k cards, in every list.
setSortableOptions (models/lib/sortableOptions.js) sets only what differs. The
swimlanes autorun also asked canModifyCard() with no card, which reads the
open card, so it re-ran on every open and close; it asks canModifyBoard().

Thanks to markusst1982 and xet7 !

Fixes #6745.
2026-10-07 03:08:48 +03:00

9 lines
431 B
JavaScript

const { changedSortableOptions } = require('/models/lib/sortableOptions');
// #6745: set jQuery UI sortable options only when their value changed - see
// models/lib/sortableOptions.js. `$el` must already be a sortable.
export function setSortableOptions($el, wanted) {
const changes = changedSortableOptions(key => $el.sortable('option', key), wanted);
if (Object.keys(changes).length > 0) $el.sortable('option', changes);
}