Skip to content

Commit 470d5db

Browse files
author
Daniel Neto
committed
Refactor getChannelTabClass function to handle empty defaultTab for improved tab state management
1 parent fb50f62 commit 470d5db

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

view/channelBody.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,26 @@ function getChannelTabClass($isTabButton, $isVideoTab = false, $defaultTab = 'ch
102102

103103
if ($isTabButton) {
104104
$_getChannelTabClassCount++;
105-
if($defaultTabGet === $defaultTab){
106-
return ' active ';
107-
}else if ($_getChannelTabClassCount == 1 && getCurrentPage() == 1) {
108-
return ' active ';
109-
} else if ($isVideoTab && getCurrentPage() != 1) {
105+
if ($defaultTabGet === $defaultTab) {
110106
return ' active ';
107+
} else if (empty($defaultTab)) {
108+
if ($_getChannelTabClassCount == 1 && getCurrentPage() == 1) {
109+
return ' active ';
110+
} else if ($isVideoTab && getCurrentPage() != 1) {
111+
return ' active ';
112+
}
111113
}
112114
return '';
113115
} else {
114116
$_getChannelTabContentClassCount++;
115-
if($defaultTabGet === $defaultTab){
116-
return ' active fade in ';
117-
}else if ($_getChannelTabContentClassCount == 1 && getCurrentPage() == 1) {
118-
return ' active fade in ';
119-
} else if ($isVideoTab && getCurrentPage() != 1) {
117+
if ($defaultTabGet === $defaultTab) {
120118
return ' active fade in ';
119+
} else if (empty($defaultTab)) {
120+
if ($_getChannelTabContentClassCount == 1 && getCurrentPage() == 1) {
121+
return ' active fade in ';
122+
} else if ($isVideoTab && getCurrentPage() != 1) {
123+
return ' active fade in ';
124+
}
121125
}
122126
return ' fade ';
123127
}
@@ -305,7 +309,7 @@ function getChannelTabClass($isTabButton, $isVideoTab = false, $defaultTab = 'ch
305309
<div id="channelLive">
306310
<?php
307311
if (!empty($liveVideos)) {
308-
createGallerySection($liveVideos, false);
312+
createGallerySection($liveVideos, false);
309313
}
310314
?>
311315
</div>

0 commit comments

Comments
 (0)