mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
javascript MDL-22067 Fixed error where help icon id wasn't always in the page
This commit is contained in:
parent
276f590e11
commit
f855a5d2d2
@ -216,7 +216,7 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
|
||||
YUI(M.yui.loader).use('yui2-container', 'yui2-event', function(Y) {
|
||||
var simpledialog = new YAHOO.widget.SimpleDialog('confirmdialog',
|
||||
{ width: '300px',
|
||||
{width: '300px',
|
||||
fixedcenter: true,
|
||||
modal: true,
|
||||
visible: false,
|
||||
@ -273,8 +273,8 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
}
|
||||
};
|
||||
|
||||
var buttons = [ { text: M.str.moodle.cancel, handler: handle_cancel, isDefault: true },
|
||||
{ text: M.str.moodle.yes, handler: handle_yes } ];
|
||||
var buttons = [ {text: M.str.moodle.cancel, handler: handle_cancel, isDefault: true},
|
||||
{text: M.str.moodle.yes, handler: handle_yes} ];
|
||||
|
||||
simpledialog.cfg.queueProperty('buttons', buttons);
|
||||
|
||||
@ -538,18 +538,18 @@ function lockoptionsall(formid) {
|
||||
var hide = false;
|
||||
switch (condition) {
|
||||
case 'notchecked':
|
||||
lock = !form[dependon].checked; break;
|
||||
lock = !form[dependon].checked;break;
|
||||
case 'checked':
|
||||
lock = form[dependon].checked; break;
|
||||
lock = form[dependon].checked;break;
|
||||
case 'noitemselected':
|
||||
lock = form[dependon].selectedIndex == -1; break;
|
||||
lock = form[dependon].selectedIndex == -1;break;
|
||||
case 'eq':
|
||||
lock = get_form_element_value(form, dependon) == value; break;
|
||||
lock = get_form_element_value(form, dependon) == value;break;
|
||||
case 'hide':
|
||||
// hide as well as disable
|
||||
hide = true; break;
|
||||
hide = true;break;
|
||||
default:
|
||||
lock = get_form_element_value(form, dependon) != value; break;
|
||||
lock = get_form_element_value(form, dependon) != value;break;
|
||||
}
|
||||
for (var ei in dependons[dependon][condition][value]) {
|
||||
var eltolock = dependons[dependon][condition][value][ei];
|
||||
@ -1408,7 +1408,10 @@ M.util.help_icon = {
|
||||
instance : null,
|
||||
add : function(Y, properties) {
|
||||
this.Y = Y;
|
||||
Y.one('#'+properties.id).on('click', this.display, this, properties);
|
||||
var node = Y.one('#'+properties.id);
|
||||
if (node) {
|
||||
node.on('click', this.display, this, properties);
|
||||
}
|
||||
},
|
||||
display : function(event, args) {
|
||||
event.preventDefault();
|
||||
|
Loading…
x
Reference in New Issue
Block a user