mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
gradebook MDL-21513 navigation dropdown in gradebook wasnt working correctly
This commit is contained in:
parent
a2ec0b8de8
commit
13a3ebca7a
@ -403,9 +403,7 @@ function lockoptionsallsetup(formid) {
|
||||
|
||||
/**
|
||||
* 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 <option> is not
|
||||
* the first one (usually the "Choose..." option)
|
||||
* submits the form designated by args.id.
|
||||
* Example usage of the html_select component with this function:
|
||||
* <pre>
|
||||
* $select = new html_select();
|
||||
@ -425,12 +423,14 @@ function submit_form_by_id(e, args) {
|
||||
if (theform.tagName.toLowerCase() != 'form') {
|
||||
return false;
|
||||
}
|
||||
if (args.selectid) {
|
||||
var select = document.getElementById(args.selectid);
|
||||
if (select.selectedIndex == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//MDL-21513 the below makes the first option unselectable assuming it will be some sort
|
||||
//of "Choose..." option. However if there is no placeholder first option the first item is unselectable :(
|
||||
//if (args.selectid) {
|
||||
// var select = document.getElementById(args.selectid);
|
||||
//if (select.selectedIndex == 0) {
|
||||
// return false;
|
||||
//}
|
||||
//}
|
||||
return theform.submit();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user