mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-26 12:11:02 -04:00
Change classesToPersist to classesPersister
Makes it sounds less like a list and more like a thing that makes classes persist, as noted in: https://github.com/alphagov/notifications-admin/pull/4155#discussion_r804638407
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
// Methods to ensure the DOM fragment is clean of classes added by JS before diffing
|
||||
// and that they are replaced afterwards.
|
||||
var classesToPersist = {
|
||||
var classesPersister = {
|
||||
classNames: [],
|
||||
$els: [],
|
||||
remove: function () {
|
||||
@@ -39,12 +39,12 @@
|
||||
};
|
||||
|
||||
var getRenderer = ($contents, key) => response => {
|
||||
classesToPersist.remove();
|
||||
classesPersister.remove();
|
||||
morphdom(
|
||||
$contents.get(0),
|
||||
$(response[key]).get(0)
|
||||
);
|
||||
classesToPersist.replace();
|
||||
classesPersister.replace();
|
||||
};
|
||||
|
||||
var getQueue = resource => (
|
||||
@@ -101,7 +101,7 @@
|
||||
if ($contents.data('classesToPersist') !== undefined) {
|
||||
$contents.data('classesToPersist')
|
||||
.split(' ')
|
||||
.forEach(className => classesToPersist.classNames.push(className));
|
||||
.forEach(className => classesPersister.classNames.push(className));
|
||||
}
|
||||
|
||||
setTimeout(
|
||||
|
||||
Reference in New Issue
Block a user