jodit-pro
Version:
PRO Version of Jodit Editor
2 lines (1 loc) • 1.25 kB
JavaScript
var a=Object.defineProperty;var n=(t,i)=>a(t,"name",{value:i,configurable:!0});import{removeElement as d}from"./remove-element.js";import{updateStateAndGme as c}from"./update-state-and-gme.js";import{UIMarkerEditor as p,UIPolygonEditor as h,UIPolylineEditor as f}from"../../editors/index.js";function l(){const t=new google.maps.InfoWindow({content:"<div>test</div>"});return t.addListener("domready",()=>{this.setMod("info-opened",!0)}),t.addListener("closeclick",()=>{this.setMod("info-opened",!1)}),t}n(l,"getInfoWindow");function u(t,i){let e;switch(this.state.mode="hand",t.type){case"polyline":e=new f(this.jodit,t.state,this.options);break;case"marker":e=new p(this.jodit,t.state,this.options);break;case"circle":case"polygon":e=new h(this.jodit,t.state,this.options);break}if(!e)return;this.append(e),this.j.e.on(e,"bin",()=>{d.call(this,t)}).on(e,"change",(s,r)=>{c.call(this,{...t.state,[s]:r},i)});const o=l.call(this);if(t.type==="polygon"||t.type==="polyline"){const s=t.gme.getPath().getAt(0);o.setPosition(s)}t.type==="circle"&&o.setPosition(t.gme.getCenter()),o.setContent(e.container),o.open(this.map,t.gme),o.addListener("closeclick",()=>{e&&(this.remove(e),e.destruct())})}n(u,"openPropsDialog");export{u as openPropsDialog};