mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-04 04:59:38 +08:00
!3727 feat(#I69304): add SupportTouch parameter on Topology component
* chore: bump version 7.1.1 * refactor: 更改脚本参数名为 SupportTouch * refactor: 更改参数名为 SupportTouch * chore: bump version 7.1.0 * feat: 增加 IsSupprtPi 参数控制是否更改 UserAgent 字符串 * feat: 增加 supportPi 参数用于控制是否更改 UserAgent 判断 * feat: topology 增加切换是否触摸参数
This commit is contained in:
parent
b0162fb8fb
commit
2ac87e4808
@ -3,7 +3,7 @@
|
||||
<Import Project="..\..\..\bundleconfig.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>7.0.0</Version>
|
||||
<Version>7.1.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -13,8 +13,8 @@ export class BlazorTopology extends BlazorComponent {
|
||||
const obj = this._config.arguments[0]
|
||||
const data = this._config.arguments[1]
|
||||
const method = this._config.arguments[2]
|
||||
|
||||
this._topology = new Topology(this._element)
|
||||
const isSupportTouch = this._config.supportTouch === true;
|
||||
this._topology = new Topology(this._element, isSupportTouch)
|
||||
this._topology.connectSocket = function () {
|
||||
}
|
||||
this._topology.open(JSON.parse(data))
|
||||
|
@ -1 +1 @@
|
||||
import BlazorComponent from"../../../_content/BootstrapBlazor/modules/base/blazor-component.js";export class BlazorTopology extends BlazorComponent{_init(){if(window.Topology){Topology.prototype.lock=function(n){this.store.data.locked=n;this.finishDrawLine(!0);this.canvas.drawingLineName="";this.stopPencil()};const n=this._config.arguments[0],t=this._config.arguments[1],i=this._config.arguments[2];this._topology=new Topology(this._element);this._topology.connectSocket=function(){};this._topology.open(JSON.parse(t));this._topology.lock(1);n.invokeMethodAsync(i)}}_execute(n){if(this._topology){const t=n[1];this._topology.doSocket(JSON.stringify(t))}}_dispose(){this._topology&&(this._topology.destroy(),this._topology=null)}}
|
||||
import BlazorComponent from"../../../_content/BootstrapBlazor/modules/base/blazor-component.js";export class BlazorTopology extends BlazorComponent{_init(){if(window.Topology){Topology.prototype.lock=function(n){this.store.data.locked=n;this.finishDrawLine(!0);this.canvas.drawingLineName="";this.stopPencil()};const n=this._config.arguments[0],t=this._config.arguments[1],i=this._config.arguments[2],r=this._config.supportTouch===!0;this._topology=new Topology(this._element,r);this._topology.connectSocket=function(){};this._topology.open(JSON.parse(t));this._topology.lock(1);n.invokeMethodAsync(i)}}_execute(n){if(this._topology){const t=n[1];this._topology.doSocket(JSON.stringify(t))}}_dispose(){this._topology&&(this._topology.destroy(),this._topology=null)}}
|
@ -1,4 +1,4 @@
|
||||
@namespace BootstrapBlazor.Components
|
||||
@inherits BootstrapModuleComponentBase
|
||||
|
||||
<div @attributes="@AdditionalAttributes" id="@Id" style="@StyleString"></div>
|
||||
<div @attributes="@AdditionalAttributes" id="@Id" style="@StyleString" data-bb-support-touch="@IsSupportTouchString"></div>
|
||||
|
@ -40,12 +40,21 @@ public partial class Topology
|
||||
[Parameter]
|
||||
public Func<Task>? OnBeforePushData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 是否支持树莓派触屏浏览器
|
||||
/// </summary>
|
||||
/// <remarks>UserAgent 增加 X11|CrOS 识别为移动端</remarks>
|
||||
[Parameter]
|
||||
public bool IsSupportTouch { get; set; }
|
||||
|
||||
private string? StyleString => CssBuilder.Default("width: 100%; height: 100%;")
|
||||
.AddStyleFromAttributes(AdditionalAttributes)
|
||||
.Build();
|
||||
|
||||
private CancellationTokenSource? CancelToken { get; set; }
|
||||
|
||||
private string? IsSupportTouchString => IsSupportTouch ? "true" : null;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user