jquery/jquery-mobile — pull request #5216 by gabrielschulhof (2012-10-24 10:10:56+00:00)
Title: The extension-based approach

Here's the extension-based approach suggested by @scottgonzalez.

Note that the code is different than it should be because of jQuery UI bug [#8724](bugs.jqueryui.com/ticket/8724).