MDL-36613 usability: Dock icons are correct in RTL mode

This commit is contained in:
Frederic Massart
2012-11-19 18:32:37 +08:00
parent 9e3f733f8a
commit 59fa7fd006
2 changed files with 27 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ 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') ) {
if (right_to_left()) {
collapsedimage = 't/collapsed_rtl';
} else {
collapsedimage = 't/collapsed';
@@ -140,7 +140,7 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
animation.on('end', function() {
this.div.toggleClass('collapsed');
var collapsedimage = 't/collapsed'; // ltr mode
if ( Y.one(document.body).hasClass('dir-rtl') ) {
if (right_to_left()) {
collapsedimage = 't/collapsed_rtl';
} else {
collapsedimage = 't/collapsed';
@@ -1209,6 +1209,20 @@ function getElementsByClassName(oElm, strTagName, name) {
return (arrReturnElements)
}
/**
* Return whether we are in right to left mode or not.
*
* @return boolean
*/
function right_to_left() {
var body = Y.one('body');
var rtl = false;
if (body && body.hasClass('dir-rtl')) {
rtl = true;
}
return rtl;
}
function openpopup(event, args) {
if (event) {