alphagov/transition — pull request #192 by fofr (2014-02-21 15:34:28+00:00)
Title: Auto-start JavaScript modules that appear in markup

* Find and auto-start modules specified using the data-module="" pattern in markup
* eg ``

`` starts the Toggle module, passing it the element as the first argument
* This makes it easier to limit modules to their containers and to start modules within certain elements, eg a modal when it has loaded. We can also remove the inline script tags and stop worrying about instantiation.
* Convert selectable_table and mappings to use this new pattern
* Split mappings into two more generic modules, toggle and toggle_mapping_form_fields
* It follows some of the principles outlined in http://www.paulrhayes.com/2013-09/a-light-progressive-framework/ (but doesn't include the dependency management using require-js)