I want to execute jQuery code on div when it’s shown (when it appears in DOM).
Trivial solution is to add code in “someCondition” helper, but I got ~30 templates with 2-3 similar cases each, and I wish if I could make this with one shot instead refactoring entire program.
Is there some jQuery.live or another trick, or UI.onUpdate thing or something that will help me?
Example I wrote is trivial - what I want is in fact execute FlatUI radio button initialization code, something like $("input[type='radio']").radiocheck();
Thanks sashko! But, your solution requires refactoring entire program, is there some “shortcut” - observing DOM changes and exec. code when template block is shown?
Yep, that’s correct. It could potentially be removed in the future, but a good number of people are using it so we’ll probably think twice before making a breaking change. If we do, we’ll make sure to warn people and provide a suitable replacement.