MDL-60061 mod_scorm: add support for drag/drop events
[moodle.git] / lib / form / url.js
blobc85326a1a678c9c7b1f62862b358b70abd85f370
1 M.form_url = {};
3 M.form_url.init = function(Y, options) {
4     options.formcallback = M.form_url.callback;
5     if (!M.core_filepicker.instances[options.client_id]) {
6         M.core_filepicker.init(Y, options);
7     }
8     Y.on('click', function(e, client_id) {
9         e.preventDefault();
10         M.core_filepicker.instances[client_id].show();
11     }, '#filepicker-button-js-'+options.client_id, null, options.client_id);
14 M.form_url.callback = function (params) {
15     document.getElementById('id_externalurl').value = params.url;