🧑💻 Only modify classes if they have content
This commit is contained in:
parent
7f82151cce
commit
ffc350651f
1 changed files with 5 additions and 0 deletions
|
|
@ -35,6 +35,10 @@ impl OptionClasses {
|
||||||
let classes: String = classes.into();
|
let classes: String = classes.into();
|
||||||
let classes: Vec<&str> = classes.split_ascii_whitespace().collect();
|
let classes: Vec<&str> = classes.split_ascii_whitespace().collect();
|
||||||
|
|
||||||
|
if classes.is_empty() {
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
match op {
|
match op {
|
||||||
ClassesOp::Add => {
|
ClassesOp::Add => {
|
||||||
self.add(&classes, self.0.len());
|
self.add(&classes, self.0.len());
|
||||||
|
|
@ -76,6 +80,7 @@ impl OptionClasses {
|
||||||
self.add(&classes, 0);
|
self.add(&classes, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue