{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-constraints/src/components/halo/lively-halo-edit-item.js"],"names":["HaloItem","HalloEditItem","onClick","lively","notify","target","getAttribute","setAttribute","updateTarget","get","classList","remove","add"],"mappings":";;;;;;AAAOA,c;;;;;;;;;;;;;;;;;;AAEQ,YAAMC,aAAN,SAA4BD,QAA5B,CAAqC;;AAElDE,kBAAU;AACRC,iBAAOC,MAAP,CAAc,aAAd;AACA,cAAI,KAAKC,MAAL,CAAYC,YAAZ,CAAyB,iBAAzB,KAA+C,MAAnD,EAA2D;AACzD,iBAAKD,MAAL,CAAYE,YAAZ,CAAyB,iBAAzB,EAA4C,IAA5C;AACD,WAFD,MAEO;AACL,iBAAKF,MAAL,CAAYE,YAAZ,CAAyB,iBAAzB,EAA4C,IAA5C;AACD;;AAED,eAAKC,YAAL,CAAkB,KAAKH,MAAvB;AAED;;AAGDG,qBAAaH,MAAb,EAAqB;AACnB,eAAKA,MAAL,GAAcA,MAAd;AACA,cAAIA,OAAOC,YAAP,CAAoB,iBAApB,KAA0C,MAA9C,EAAsD;AACpD,iBAAKG,GAAL,CAAS,QAAT,EAAmBC,SAAnB,CAA6BC,MAA7B,CAAoC,UAApC;AACD,WAFD,MAEO;AACL,iBAAKF,GAAL,CAAS,QAAT,EAAmBC,SAAnB,CAA6BE,GAA7B,CAAiC,UAAjC;AACD;AACF;AAtBiD;;yBAA/BX,a","file":"lively-halo-edit-item.js","sourcesContent":["import HaloItem from 'src/components/halo/lively-halo-item.js';\n\nexport default class HalloEditItem extends HaloItem {\n\n  onClick() {\n    lively.notify(\"toggle edit\")\n    if (this.target.getAttribute(\"contenteditable\") == \"true\") {\n      this.target.setAttribute(\"contenteditable\", null)\n    } else {\n      this.target.setAttribute(\"contenteditable\", true)\n    }\n    \n    this.updateTarget(this.target)\n    \n  }\n  \n  \n  updateTarget(target) {\n    this.target = target\n    if (target.getAttribute(\"contenteditable\") == \"true\") {\n      this.get(\"#label\").classList.remove(\"disabled\")\n    } else {\n      this.get(\"#label\").classList.add(\"disabled\")\n    }\n  }\n}"]}