Skip to content

Commit 30f3eb5

Browse files
authored
feat(browser): support Huawei browser (#7453)
* refactor: 更新 browser 脚本 * refactor: 重构脚本 * refactor: 更改 PC 为 Desktop * chore: bump version 10.2.1-beta02
1 parent 36a30dd commit 30f3eb5

File tree

6 files changed

+25
-488
lines changed

6 files changed

+25
-488
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>10.2.1-beta01</Version>
4+
<Version>10.2.1-beta02</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export { getResponsive } from '../../modules/responsive.js'
22
import { copy, drag, getDescribedElement, getOuterHeight, getWidth, isVisible } from '../../modules/utility.js'
3-
import '../../modules/browser.js'
3+
import browser from '../../modules/browser.min.mjs'
44
import Data from '../../modules/data.js'
55
import EventHandler from '../../modules/event-handler.js'
66
import Popover from "../../modules/base-popover.js"
@@ -54,7 +54,7 @@ export function saveColumnOrder(options) {
5454
localStorage.setItem(key, JSON.stringify(options.columns));
5555
}
5656

57-
export function reset(id) {
57+
export async function reset(id) {
5858
const table = Data.get(id)
5959
if (table === null) {
6060
return;
@@ -79,7 +79,7 @@ export function reset(id) {
7979
table.tables.push(table.thead.firstChild)
8080
table.tables.push(table.body.firstChild)
8181
table.scrollWidth = parseFloat(table.body.style.getPropertyValue('--bb-scroll-width'));
82-
fixHeader(table)
82+
await fixHeader(table);
8383

8484
EventHandler.on(table.body, 'scroll', () => {
8585
const left = table.body.scrollLeft
@@ -388,7 +388,7 @@ const setBodyHeight = table => {
388388
}
389389
}
390390

391-
const fixHeader = table => {
391+
const fixHeader = async table => {
392392
const el = table.el
393393
const fs = el.querySelector('.fixed-scroll')
394394

@@ -398,8 +398,8 @@ const fixHeader = table => {
398398
if (prev.classList.contains('fixed-right') && !prev.classList.contains('modified')) {
399399
let margin = prev.style.right
400400
margin = margin.replace('px', '')
401-
const b = window.browser()
402-
if (b.device !== 'PC') {
401+
const b = await browser.getInfo();
402+
if (b.device !== 'Desktop') {
403403
margin = (parseFloat(margin) - table.scrollWidth) + 'px'
404404
}
405405
prev.classList.add('modified')

src/BootstrapBlazor/Enums/WebClientDeviceType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -13,7 +13,7 @@ public enum WebClientDeviceType
1313
/// <summary>
1414
///
1515
/// </summary>
16-
PC,
16+
Desktop,
1717

1818
/// <summary>
1919
///

0 commit comments

Comments
 (0)