humanmade/Custom-Meta-Boxes — pull request #118 by mattheu (2013-11-14 00:27:30+00:00)
Title: Fields not initialized if meta box is collapsed on page load

If a meta box is collapsed (a WordPress feature) then some fields are not initialized on page load. eg select2

We should re-initialize when expanding. easy!

The only issue doing this is that callbacks were getting attached to events multiple times - so I am have updated to use event namespaces and I am unbinding all CMB click events before re-adding. This prevents duplication.

In the process I neatened up the JS a little. I realize that I didn't need to be messing about with `_this` - we can directly access `CMB`