BinkyBonkers/Blazor-SBAdmin2

Expand Colapse Button not working

Opened this issue · 3 comments

Looklike BlazorAdmin2/wwwroot/js/sb-admin-2.js not working. Make it working please... Ty.

Can you please be a bit more specific? What error are you getting, which browser are you using, etc.

Thanks

Hi,
sidebarToggle not working in any browser..can u please check

image

To solve it create a javascript function to toggle collapse:

function toggleCollapse() {
    $("body").toggleClass("sidebar-toggled");
    $(".sidebar").toggleClass("toggled");
    if ($(".sidebar").hasClass("toggled")) {
        $('.sidebar .collapse').collapse('hide');
    };
};

And modify Sidebar Toggler element in SidebarNav.razor

        <!-- Sidebar Toggler (Sidebar) -->
        <div class="text-center d-none d-md-inline">
            <button class="rounded-circle border-0" id="sidebarToggle" onclick="toggleCollapse()"></button>
            <!--
            <button class="rounded-circle border-0" id="sidebarToggle"></button>
            -->
        </div>