-
-
Notifications
You must be signed in to change notification settings - Fork 374
feat(browser): support Huawei browser #7453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| export { getResponsive } from '../../modules/responsive.js' | ||
| import { copy, drag, getDescribedElement, getOuterHeight, getWidth, isVisible } from '../../modules/utility.js' | ||
| import '../../modules/browser.js' | ||
| import browser from '../../modules/browser.min.mjs' | ||
| import Data from '../../modules/data.js' | ||
| import EventHandler from '../../modules/event-handler.js' | ||
| import Popover from "../../modules/base-popover.js" | ||
|
|
@@ -54,7 +54,7 @@ export function saveColumnOrder(options) { | |
| localStorage.setItem(key, JSON.stringify(options.columns)); | ||
| } | ||
|
|
||
| export function reset(id) { | ||
| export async function reset(id) { | ||
| const table = Data.get(id) | ||
| if (table === null) { | ||
| return; | ||
|
|
@@ -79,7 +79,7 @@ export function reset(id) { | |
| table.tables.push(table.thead.firstChild) | ||
| table.tables.push(table.body.firstChild) | ||
| table.scrollWidth = parseFloat(table.body.style.getPropertyValue('--bb-scroll-width')); | ||
| fixHeader(table) | ||
| await fixHeader(table); | ||
|
|
||
| EventHandler.on(table.body, 'scroll', () => { | ||
| const left = table.body.scrollLeft | ||
|
|
@@ -388,7 +388,7 @@ const setBodyHeight = table => { | |
| } | ||
| } | ||
|
|
||
| const fixHeader = table => { | ||
| const fixHeader = async table => { | ||
| const el = table.el | ||
| const fs = el.querySelector('.fixed-scroll') | ||
|
|
||
|
|
@@ -398,8 +398,8 @@ const fixHeader = table => { | |
| if (prev.classList.contains('fixed-right') && !prev.classList.contains('modified')) { | ||
| let margin = prev.style.right | ||
| margin = margin.replace('px', '') | ||
| const b = window.browser() | ||
| if (b.device !== 'PC') { | ||
| const b = await browser.getInfo(); | ||
| if (b.device !== 'Desktop') { | ||
|
||
| margin = (parseFloat(margin) - table.scrollWidth) + 'px' | ||
| } | ||
| prev.classList.add('modified') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
| // See the LICENSE file in the project root for more information. | ||
| // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||
|
|
@@ -13,7 +13,7 @@ public enum WebClientDeviceType | |
| /// <summary> | ||
| /// | ||
| /// </summary> | ||
| PC, | ||
| Desktop, | ||
|
||
|
|
||
| /// <summary> | ||
| /// | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to
browser.getInfo()is made without parameters, but in client.js the same method is called with parameters:browser.getInfo(['browser', 'system', 'device', 'language']). According to the browser-tool library API, both usages are valid - calling without parameters will fetch all available information. However, for consistency and performance, consider specifying only the needed properties. In this case, only the 'device' property is needed, so the call could be optimized tobrowser.getInfo(['device']).