diff --git a/lib/javascript-static.js b/lib/javascript-static.js index a72f797c9a4..8793bb2dd8f 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -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();