Skip to content

Commit

Permalink
Merge branch 'MDL-38090-m' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 25, 2013
2 parents 2a80528 + e691028 commit 1e171d4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/form/yui/shortforms/shortforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
Expand Down
7 changes: 6 additions & 1 deletion lib/form/yui/showadvanced/showadvanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 3 additions & 1 deletion lib/outputrequirementslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ public function __construct() {
$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/';
Expand All @@ -182,7 +185,6 @@ public function __construct() {
}

// 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;
Expand Down

0 comments on commit 1e171d4

Please sign in to comment.