Skip to content
Snippets Groups Projects
Commit 1275566c authored by Justin Toupin's avatar Justin Toupin
Browse files

Refactor LPSortableInstances to use Map() and Set()

parent 7c4dc7d9
No related branches found
No related tags found
1 merge request!191Issue #3467793 by nicholass, mistrytheory, ckng, gnuschichten, vit.smutny:...
......@@ -417,17 +417,15 @@
* API for adding Layout Paragraphs Sortable.js instances.
*/
Drupal.LPSortableInstances = {
intances: {},
instances: new Map(),
add: function (id, instance) {
if (this.intances[id]) {
this.intances[id].push(instance);
}
else {
this.intances[id] = [instance];
if (!this.instances.has(id)) {
this.instances.set(id, new Set());
}
this.instances.get(id).add(instance);
},
get: function (id) {
return this.intances[id] || [];
return this.instances.get(id) || new Set();
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment