From dc580207941d170339666a55d3cd6fc49830e208 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 28 Jul 2009 11:24:57 +0000 Subject: [PATCH] MDL-19756 Refactored JS code from SCORM and choice modules into the core function submit_form_by_id() --- lib/javascript-static.js | 30 +++++++++++++++++++++++++----- mod/choice/choice.js | 5 ----- mod/choice/lib.php | 3 +-- mod/scorm/report.php | 3 +-- mod/scorm/scorm.js | 5 ----- 5 files changed, 27 insertions(+), 19 deletions(-) delete mode 100644 mod/choice/choice.js delete mode 100644 mod/scorm/scorm.js diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 5e45a675f6..0f4de7a720 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -205,17 +205,37 @@ function lockoptionsallsetup(formid) { return lockoptionsall(formid); } -function submit_form_by_id(e, args) { +/** + * Helper function mainly for drop-down menus' onchange events, + * submits the form designated by args.id. If args.selectid is also + * given, it only submits the form if the selected