MDL-38049 form: Collapsed sections are hidden on page load

This commit is contained in:
Frederic Massart 2013-03-13 10:28:37 +08:00
parent 8673a98d1d
commit 0b8bb3fe5f
3 changed files with 4 additions and 6 deletions

View File

@ -23,8 +23,7 @@ YUI.add('moodle-form-shortforms', function(Y) {
},
CSS = {
COLLAPSED : 'collapsed',
FHEADER : 'fheader',
JSPROCESSED : 'jsprocessed'
FHEADER : 'fheader'
},
ATTRS = {};
@ -67,7 +66,6 @@ YUI.add('moodle-form-shortforms', function(Y) {
Y.one('#'+this.get('formid')).delegate('click', this.switch_state, SELECTORS.FIELDSETCOLLAPSIBLE+' .'+CSS.FHEADER);
},
process_fieldset : function(fieldset) {
fieldset.addClass(CSS.JSPROCESSED);
// Get legend element.
var legendelement = fieldset.one(SELECTORS.LEGENDFTOGGLER);

View File

@ -112,7 +112,7 @@ class behat_forms extends behat_base {
try {
// Expand fieldsets.
$fieldsets = $this->find_all('css', 'fieldset.collapsed.jsprocessed a.fheader');
$fieldsets = $this->find_all('css', 'fieldset.collapsed a.fheader');
// We are supposed to have fieldsets here, otherwise exception.

View File

@ -241,8 +241,8 @@ a.skip:active {position: static;display: block;}
.mform fieldset.error {border: 1px solid #A00;}
.mform fieldset.collapsible legend a.fheader {padding: 0 5px 0 20px; background: url([[pix:t/expanded]]) 2px center no-repeat;}
.mform fieldset.collapsed legend a.fheader {background: url([[pix:t/collapsed]]) 2px center no-repeat;}
.mform fieldset.collapsed.jsprocessed {border-width: 1px 0 0 0; padding: 0;}
.mform fieldset.collapsed.jsprocessed div.fcontainer {display: none;}
.jsenabled .mform fieldset.collapsed {border-width: 1px 0 0 0; padding: 0;}
.jsenabled .mform fieldset.collapsed div.fcontainer {display: none;}
.mform .fitem {width:100%;overflow:hidden;margin-top:5px;margin-bottom:1px;clear:right;}
.mform .fitem .fitemtitle {width:15%;text-align:right;float:left;}
.mform .fitem .fitemtitle div {display: inline;}