Merge branch 'MDL-38090-m' of git://github.com/andrewnicols/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-02-26 00:33:32 +01:00
commit 1e171d4d37
3 changed files with 15 additions and 3 deletions

View file

@ -84,7 +84,12 @@ YUI.add('moodle-form-shortforms', function(Y) {
fieldset.toggleClass(CSS.COLLAPSED);
// Get corresponding hidden variable
// - and invert it.
var statuselement = new Y.one('input[name=mform_isexpanded_'+fieldset.get('id')+']');
var statuselement = Y.one('input[name=mform_isexpanded_'+fieldset.get('id')+']');
if (!statuselement) {
Y.log("M.form.shortforms::switch_state was called on an fieldset without a status field: '" +
fieldset.get('id') + "'", 'debug');
return;
}
statuselement.set('value', Math.abs(Number(statuselement.get('value'))-1));
}
});

View file

@ -67,7 +67,12 @@ YUI.add('moodle-form-showadvanced', function(Y) {
Y.one('#'+this.get('formid')).delegate('click', this.switch_state, SELECTORS.FIELDSETCONTAINSADVANCED+' .'+CSS.MORELESSTOGGLER);
},
process_fieldset : function(fieldset) {
var statuselement = new Y.one('input[name=mform_showmore_'+fieldset.get('id')+']');
var statuselement = Y.one('input[name=mform_showmore_'+fieldset.get('id')+']');
if (!statuselement) {
Y.log("M.form.showadvanced::process_fieldset was called on an fieldset without a status field: '" +
fieldset.get('id') + "'", 'debug');
return;
}
var morelesslink = Y.Node.create('<a href="#"></a>');
morelesslink.addClass(CSS.MORELESSTOGGLER);
if (statuselement.get('value') === '0') {

View file

@ -155,12 +155,15 @@ class page_requirements_manager {
$sep = empty($CFG->yuislasharguments) ? '?' : '/';
$this->yui3loader = new stdClass();
$this->YUI_config = new stdClass();
// Set up some loader options.
if (debugging('', DEBUG_DEVELOPER)) {
$this->yui3loader->filter = 'RAW'; // For more detailed logging info use 'DEBUG' here.
$this->YUI_config->debug = true;
} else {
$this->yui3loader->filter = null;
$this->YUI_config->debug = false;
}
if (!empty($CFG->useexternalyui) and strpos($CFG->httpswwwroot, 'https:') !== 0) {
$this->yui3loader->base = 'http://yui.yahooapis.com/' . $CFG->yui3version . '/build/';
@ -182,7 +185,6 @@ class page_requirements_manager {
}
// Set up JS YUI loader helper object.
$this->YUI_config = new stdClass();
$this->YUI_config->base = $this->yui3loader->base;
$this->YUI_config->comboBase = $this->yui3loader->comboBase;
$this->YUI_config->combine = $this->yui3loader->combine;