smugmug/yui-gallery — pull request #28 by bwg (2013-07-02 20:51:55+00:00)
Title: Allow `Editor.command()` to take functions as arguments

Because the editor *needs* to have focus when executing a command, `focus()` is the very first thing called in `command()`

Some commands however do not simply pass through to `_execCommand()` (`link()` being the primary use-case), so to avoid having to call `focus()` manually all over the codebase when bypassing `_execCommand()`, passing a function into `command()` seemed the best compromise.