-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTopology.razor.min.js
More file actions
1 lines (1 loc) · 1.22 KB
/
Topology.razor.min.js
File metadata and controls
1 lines (1 loc) · 1.22 KB
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],r=this._config.supportTouch===!0,u=this._config.fitView===!0,f=this._config.centerView===!0;this._topology=new Topology(this._element,{},r);this._topology.connectSocket=function(){};this._topology.open(JSON.parse(t));this._topology.lock(1);u&&this._topology.fitView();f&&this._topology.centerView();n.invokeMethodAsync(i)}}_execute(n){var t,i;if(this._topology)if(t=n[1],t==="reset")this._topology.fitView(),this._topology.centerView();else if(t==="scale"&&n.length>2)i=n[2],i>0&&(this._topology.scale(i),this._topology.centerView());else if(t=="resize"){if(this._topology.canvas.dirty=!0,n.lengh>4){const t=n[2],i=n[3];this._topology.resize(t,i)}else this._topology.resize();this._topology.fitView();this._topology.centerView()}else this._topology.doSocket(JSON.stringify(t))}_dispose(){this._topology&&(this._topology.destroy(),this._topology=null)}}