File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ /*globals CustomEvent*/
2+ import action from '@cocreate/action' ;
13
2- // import action from '@cocreate/action';
34
45const CoCreateRender = {
56
@@ -177,6 +178,22 @@ const CoCreateRender = {
177178
178179}
179180
181+ function removeElement ( btn ) {
182+ let element = btn . closest ( '[templateid]' ) ;
183+ if ( element )
184+ element . remove ( ) ;
185+ document . dispatchEvent ( new CustomEvent ( 'removeElement' , { detail : { } } ) ) ;
186+ }
187+
188+ action . init ( {
189+ action : "removeElement" ,
190+ endEvent : "removeElement" ,
191+ callback : ( btn , data ) => {
192+ removeElement ( btn ) ;
193+ }
194+ } ) ;
195+
196+
180197// function renderKey(element) {
181198// const container = element.closest("form") || document;
182199// let data = form.getFormData(this.id, 'renderKey', container);
You can’t perform that action at this time.
0 commit comments