Skip to content

Commit

Permalink
feat(RibbonTab): reset ribbon-tab item min-width to 58px (#2890)
Browse files Browse the repository at this point in the history
* fix: 调整 Ribbon 菜单最小宽度为 58

* refactor: 重构开发环境 JSInvoke 报错信息
  • Loading branch information
ArgoZhang committed Feb 3, 2024
1 parent 632212b commit 4d4b012
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
34 changes: 26 additions & 8 deletions src/BootstrapBlazor/Utils/JSModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ async ValueTask InvokeVoidAsync()
{
await Module.InvokeVoidAsync(identifier, cancellationToken, [.. paras]);
}
#if DEBUG
catch (JSException)
{
#if DEBUG
System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}");
throw;
}
#endif
}
catch (JSDisconnectedException) { }
catch (OperationCanceledException) { }
catch (ObjectDisposedException) { }
catch (ObjectDisposedException)
{
#if DEBUG
System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}");
throw;
#endif
}
}
}

Expand Down Expand Up @@ -121,16 +127,22 @@ async ValueTask<TValue> InvokeAsync()
{
ret = await Module.InvokeAsync<TValue>(identifier, cancellationToken, [.. paras]);
}
#if DEBUG
catch (JSException)
{
#if DEBUG
System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}");
throw;
}
#endif
}
catch (JSDisconnectedException) { }
catch (OperationCanceledException) { }
catch (ObjectDisposedException) { }
catch (ObjectDisposedException)
{
#if DEBUG
System.Console.WriteLine($"identifier: {identifier} args: {string.Join(" ", args ?? [])}");
throw;
#endif
}

return ret;
}
Expand All @@ -144,12 +156,18 @@ protected virtual async ValueTask DisposeAsyncCore(bool disposing)
{
if (disposing)
{
// TODO: 微软的代码这里加上 await 就会线程死锁
try
{
await Module.DisposeAsync();
}
catch { }
catch (JSDisconnectedException) { }
catch (Exception)
{
#if DEBUG
System.Console.WriteLine($"{GetType().FullName} disposing throw exception");
throw;
#endif
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ $bb-ribbon-button-border-color: transparent;
$bb-ribbon-button-radius: 3px;
$bb-ribbon-button-padding: 0.25rem;
$bb-ribbon-button-fontsize: 0.75rem;
$bb-ribbon-button-min-width: 56px;
$bb-ribbon-button-min-width: 58px;
$bb-ribbon-group-fontsize: 11px;
$bb-ribbon-group-color: #adb5bd;
$bb-ribbon-group-margin-top: .25rem;
Expand Down

0 comments on commit 4d4b012

Please sign in to comment.