🚧 [megamenu] Improve linking with dynamic urls

This commit is contained in:
Manuel Cillero 2023-07-31 11:46:28 +02:00
parent c054081390
commit 7b821da411
3 changed files with 45 additions and 46 deletions

View file

@ -1,7 +1,7 @@
use pagetop::prelude::*;
use pagetop_jquery::JQuery;
use crate::component::MegaMenuItem;
use crate::component::MegaItem;
use crate::LOCALES_MEGAMENU;
new_handle!(COMPONENT_MEGAMENU);
@ -138,12 +138,12 @@ impl MegaMenu {
self
}
pub fn with_item(mut self, item: MegaMenuItem) -> Self {
pub fn with_item(mut self, item: MegaItem) -> Self {
self.items.alter(PackOp::Add, ComponentRef::to(item));
self
}
pub fn alter_items(&mut self, op: PackOp, item: MegaMenuItem) -> &mut Self {
pub fn alter_items(&mut self, op: PackOp, item: MegaItem) -> &mut Self {
self.items.alter(op, ComponentRef::to(item));
self
}