Revert type for classes

This commit is contained in:
Manuel Cillero 2023-09-12 00:27:54 +02:00
parent 45d8c55e61
commit 330338c7ef
19 changed files with 152 additions and 153 deletions

View file

@ -123,21 +123,21 @@ impl Anchor {
}
#[fn_builder]
pub fn alter_classes(&mut self, op: ClassesOp, classes: &[impl ToString]) -> &mut Self {
pub fn alter_classes(&mut self, op: ClassesOp, classes: impl Into<String>) -> &mut Self {
self.classes.alter_value(op, classes);
self
}
#[fn_builder]
pub fn alter_type(&mut self, anchor_type: AnchorType) -> &mut Self {
self.anchor_type = anchor_type;
self.classes.alter_value(
self.alter_classes(
ClassesOp::SetDefault,
match self.anchor_type {
AnchorType::Button => &["btn", "btn-primary"],
_ => &[],
match anchor_type {
AnchorType::Button => "btn btn-primary",
_ => "",
},
);
self.anchor_type = anchor_type;
self
}