Skip to content

Commit

Permalink
Merge branch 'MDL-38691-master-int' of git://github.com/FMCorz/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 3, 2013
2 parents 5e45f6a + c55cd6a commit 5cc929b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/form/yui/showadvanced/showadvanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ YUI.add('moodle-form-showadvanced', function(Y) {
},
CSS = {
SHOW : 'show',
MORELESSTOGGLER : 'morelesstoggler'
MORELESSACTIONS: 'moreless-actions',
MORELESSTOGGLER : 'moreless-toggler',
SHOWLESS : 'moreless-less'
},
WRAPPERS = {
FITEM : '<div class="fitem"></div>',
FELEMENT : '<div class="felement"></div>'
},
ATTRS = {};

Expand Down Expand Up @@ -73,15 +79,24 @@ YUI.add('moodle-form-showadvanced', function(Y) {
fieldset.get('id') + "'", 'debug');
return;
}

var morelesslink = Y.Node.create('<a href="#"></a>');
morelesslink.addClass(CSS.MORELESSTOGGLER);
if (statuselement.get('value') === '0') {
morelesslink.setHTML(M.str.form.showmore);
} else {
morelesslink.setHTML(M.str.form.showless);
morelesslink.addClass(CSS.SHOWLESS);
fieldset.all(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);
}
fieldset.one(SELECTORS.DIVFCONTAINER).append(morelesslink);

var fitem = Y.Node.create(WRAPPERS.FITEM);
fitem.addClass(CSS.MORELESSACTIONS);
var felement = Y.Node.create(WRAPPERS.FELEMENT);
felement.append(morelesslink);
fitem.append(felement);

fieldset.one(SELECTORS.DIVFCONTAINER).append(fitem);
},
switch_state : function(e) {
e.preventDefault();
Expand All @@ -93,9 +108,11 @@ YUI.add('moodle-form-showadvanced', function(Y) {
// Invert it and change the link text.
if (statuselement.get('value') === '0') {
statuselement.set('value', 1);
this.addClass(CSS.SHOWLESS);
this.setHTML(M.util.get_string('showless', 'form'));
} else {
statuselement.set('value', 0);
this.removeClass(CSS.SHOWLESS);
this.setHTML(M.util.get_string('showmore', 'form'));
}
}
Expand Down
Binary file added pix/t/less.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions pix/t/less.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/t/more.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions pix/t/more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions theme/base/style/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ a.skip:active {position: static;display: block;}
.mform fieldset.fdate_selector label {display:inline;float: none;width: auto;}
.mform .ftags label.accesshide {display: block;position: static;}
.mform .ftags select {margin-bottom: 0.7em;min-width: 22em;}
.mform .moreless-toggler {background: url([[pix:t/more]]) left center no-repeat; padding-left: 16px;}
.dir-rtl .moreless-toggler {padding-left: 0; padding-right: 16px; background-position: right center; }
.mform .moreless-less {background-image: url([[pix:t/less]]);}
.mform .helplink img { margin: 0 0 0 .45em; padding: 0;}
.dir-rtl .mform .helplink img { margin: 0 .45em 0 0; padding: 0;}
.mform legend .helplink img { margin-right: .2em; }
Expand Down

0 comments on commit 5cc929b

Please sign in to comment.