mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 20:38:24 -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
|
// Methods to ensure the DOM fragment is clean of classes added by JS before diffing
|
||||||
// and that they are replaced afterwards.
|
// and that they are replaced afterwards.
|
||||||
var classesToPersist = {
|
var classesPersister = {
|
||||||
classNames: [],
|
classNames: [],
|
||||||
$els: [],
|
$els: [],
|
||||||
remove: function () {
|
remove: function () {
|
||||||
@@ -39,12 +39,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getRenderer = ($contents, key) => response => {
|
var getRenderer = ($contents, key) => response => {
|
||||||
classesToPersist.remove();
|
classesPersister.remove();
|
||||||
morphdom(
|
morphdom(
|
||||||
$contents.get(0),
|
$contents.get(0),
|
||||||
$(response[key]).get(0)
|
$(response[key]).get(0)
|
||||||
);
|
);
|
||||||
classesToPersist.replace();
|
classesPersister.replace();
|
||||||
};
|
};
|
||||||
|
|
||||||
var getQueue = resource => (
|
var getQueue = resource => (
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
if ($contents.data('classesToPersist') !== undefined) {
|
if ($contents.data('classesToPersist') !== undefined) {
|
||||||
$contents.data('classesToPersist')
|
$contents.data('classesToPersist')
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.forEach(className => classesToPersist.classNames.push(className));
|
.forEach(className => classesPersister.classNames.push(className));
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(
|
setTimeout(
|
||||||
|
|||||||
Reference in New Issue
Block a user