Dont store empty classes or events if they are null upon change.
This commit is contained in:
@@ -276,8 +276,13 @@ class IgniteTemplate {
|
||||
}
|
||||
}
|
||||
|
||||
//Remove the old value
|
||||
this.classes = this.classes.filter(cl => cl != oldValue && cl != newValue);
|
||||
this.classes.push(newValue);
|
||||
|
||||
//Add the new value if its valid.
|
||||
if (newValue !== null && newValue !== undefined) {
|
||||
this.classes.push(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +358,11 @@ class IgniteTemplate {
|
||||
|
||||
//Remove the old value from the events
|
||||
this.events[eventName] = this.events[eventName].filter(ev => ev != oldValue);
|
||||
this.events[eventName].push(newValue);
|
||||
|
||||
//Add the new value if it's needed
|
||||
if (newValue !== null && newValue !== undefined) {
|
||||
this.events[eventName].push(newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user