mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-26167 lib/form: Altering Javascript so that "disabledIf" will disable the "Choose" button for a filepicker
This commit is contained in:
parent
91787c37e1
commit
4b72f9eb78
4 changed files with 22 additions and 2 deletions
|
@ -198,12 +198,25 @@ M.form.initFormDependencies = function(Y, formid, dependencies) {
|
|||
*/
|
||||
_disableElement : function(name, disabled) {
|
||||
var els = this.elementsByName(name);
|
||||
var form = this;
|
||||
els.each(function(){
|
||||
if (disabled) {
|
||||
this.setAttribute('disabled', 'disabled');
|
||||
} else {
|
||||
this.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
// Extra code to disable a filepicker
|
||||
if (this.getAttribute('class') == 'filepickerhidden'){
|
||||
var pickerbuttons = form.elementsByName(name + 'choose');
|
||||
pickerbuttons.each(function(){
|
||||
if (disabled){
|
||||
this.setAttribute('disabled','disabled');
|
||||
} else {
|
||||
this.removeAttribute('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue