[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

example[spec] Remove a widget -changed for ios

" App names a MobileApplication instance "
" remove #information widget "

| jsObject js widgets newSpec currentThread coordinator |
currentThread := (App threads select: [:thread | thread tool = #mobile]) first.

coordinator := currentThread coordinator. 

jsObject := coordinator template basicAt: #spec.
js := JS @ jsObject. 
widgets := (JS @ (js @ #configuration)) @ #widgets.

" remove property from spec "
(JS @ widgets) delete: #information.

" remove widget from coordinator "
coordinator widgets removeKey: #information. 

" udpate rendered UI "
App fromJSon: (App basicAt: #spec).
App open