mirror of
https://github.com/wekan/wekan.git
synced 2026-11-07 11:02:33 -05:00
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.
9 lines
431 B
JavaScript
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);
|
|
}
|