All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.util.dragAndDrop.DragRegistry.js Maven / Gradle / Ivy

"use strict";let t=null,n=!1;const r=new Set,d=new Set,a=e=>{!e.dataTransfer||!(e.target instanceof HTMLElement)||d.has(e.target)||(t=e.target)},o=()=>{t=null},l=()=>{t=null},s=e=>{t=e},g=()=>t,c=()=>{n||(document.body.addEventListener("dragstart",a),document.body.addEventListener("dragend",o),document.body.addEventListener("drop",l))},m=()=>{document.body.removeEventListener("dragstart",a),document.body.removeEventListener("dragend",o),document.body.removeEventListener("drop",l),n=!1},E=e=>{r.add(e),n||c()},u=e=>{r.delete(e),r.size===0&&n&&m()},i=e=>(d.add(e),s),b=e=>{d.delete(e)},f={subscribe:E,unsubscribe:u,addSelfManagedArea:i,removeSelfManagedArea:b,getDraggedElement:g};export default f;
//# sourceMappingURL=DragRegistry.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy