Skip to content

Commit

Permalink
Add call js for adding tooltip and popup after selecting tab (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brano5 authored Jun 11, 2024
1 parent d174d3b commit 0ed2b81
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<CascadingValue Value="this">
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime

<CascadingValue Value="this">
<ul class="nav nav-tabs mb-3">
@foreach (TabPage tabPage in Pages)
{
<li class="nav-item">
<button type="button"
class="@GetButtonClass(tabPage)"
@onclick=@( () => ActivatePage(tabPage) )>
@onclick=@( () => ActivatePageAsync(tabPage) )>
<b> @tabPage.Text</b>
</button>
</li>
Expand Down Expand Up @@ -35,8 +38,11 @@
return page == ActivePage ? "nav-link active" : "nav-link";
}

void ActivatePage(TabPage page)
async Task ActivatePageAsync(TabPage page)
{
ActivePage = page;

var module = await JSRuntime.InvokeAsync<IJSObjectReference>("import", "/js/addToolTipsAndPopOvers.js");
await module.InvokeVoidAsync("addToolTipsAndPopOvers");
}
}

0 comments on commit 0ed2b81

Please sign in to comment.