=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.util.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.util.js 2014-10-10 07:00:58 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.util.js 2014-10-10 07:10:36 +0000 @@ -166,6 +166,16 @@ }; /** + * Convenience method to be used from inside custom forms. When a function is + * registered inside a form it will be loaded every time the form is loaded, + * hence the need to unregister and the register the function. + */ +dhis2.util.on = function( event, fn ) +{ + $( document ).off( event ).on( event, fn ); +}; + +/** * adds ':containsNC' to filtering. * $(sel).find(':containsNC(key)').doSomething(); */