Skip to content

Commit 7250c34

Browse files
Reset split info if skipped
Don't reuse other menus split info when we loop over the menu to build our cols
1 parent 9ab276e commit 7250c34

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/MegaMenuBuilder.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ protected function checkSplit(array $items): bool {
172172

173173
// Only columns bigger then 2 can have a split column.
174174
if ($this->cols <= 2) {
175+
$this->split = FALSE;
176+
$this->splitId = '';
177+
$this->splitAmount = 0;
178+
175179
return FALSE;
176180
}
177181

@@ -182,6 +186,10 @@ protected function checkSplit(array $items): bool {
182186
$after = array_key_last($items) != $split_id;
183187
// Has items before and after then don't split.
184188
if ($before & $after) {
189+
$this->split = FALSE;
190+
$this->splitId = '';
191+
$this->splitAmount = 0;
192+
185193
return FALSE;
186194
}
187195
}
@@ -333,6 +341,7 @@ protected function constructColumns(array $items): array {
333341
$col_dividend = $col_position_amount;
334342
$col_disvisor = 2;
335343
}
344+
336345
// Calculate the ideal amount of links in each column. We take the total
337346
// links of the level 1 menu item (menu level 2 + 3) and divide by the
338347
// amount of columns.

0 commit comments

Comments
 (0)