MDL-35481 - Invert "search option" listbox "open" arrow, when in RTL mode (page: manual user course registration ) and Personal Blog page

This commit is contained in:
Nadav Kavalerchik
2012-09-22 21:05:14 +03:00
parent c8ac480979
commit 9fe40de660
4 changed files with 37 additions and 6 deletions

View File

@@ -103,9 +103,15 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
// Get the height of the div at this point before we shrink it if required
var height = this.div.get('offsetHeight');
var collapsedimage = 't/collapsed'; // ltr mode
if ( Y.one(document.body).hasClass('dir-rtl') ) {
collapsedimage = 't/collapsed_rtl';
} else {
collapsedimage = 't/collapsed';
}
if (this.div.hasClass('collapsed')) {
// Add the correct image and record the YUI node created in the process
this.icon = Y.Node.create('<img src="'+M.util.image_url('t/collapsed', 'moodle')+'" alt="" />');
this.icon = Y.Node.create('<img src="'+M.util.image_url(collapsedimage, 'moodle')+'" alt="" />');
// Shrink the div as it is collapsed by default
this.div.setStyle('height', caption.get('offsetHeight')+'px');
} else {
@@ -126,8 +132,14 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
// Handler for the animation finishing.
animation.on('end', function() {
this.div.toggleClass('collapsed');
var collapsedimage = 't/collapsed'; // ltr mode
if ( Y.one(document.body).hasClass('dir-rtl') ) {
collapsedimage = 't/collapsed_rtl';
} else {
collapsedimage = 't/collapsed';
}
if (this.div.hasClass('collapsed')) {
this.icon.set('src', M.util.image_url('t/collapsed', 'moodle'));
this.icon.set('src', M.util.image_url(collapsedimage, 'moodle'));
} else {
this.icon.set('src', M.util.image_url('t/expanded', 'moodle'));
}