Currently Horizon does not provide the way to add custom javascript for the application that is built on top of it. All the javascript files have to be included in horizon/templates/horizon/_scripts.html.
The solution: add the {% block custom_js %}{% endblock %} before the end of list of scripts in horizon/templates/horizon/_scripts.html. Dashboard's base.html then overrides "block js" with inclusion of its own _scripts.html which extends horizon/_scripts.html and overrides "block custom_js" including all js files needed by given dashboard. Result is single compressed js file consisting both Horizon and Dashboard's custom scripts.
I belive implementing this is also one of the steps in making Horizon standalone (http://lists.openstack.org/pipermail/openstack-dev/2013-June/010808.html)
Fix proposed to branch: master /review. openstack. org/34878
Review: https:/