NXP-15564: refactor and fix ajax logics on toggleable layout widget template, as well as actions inclusion
NXP-15565: make sure document mode can be controlled on toggleable document widget