From 50a4186ef949ecaf7ab4977048160820587218d2 Mon Sep 17 00:00:00 2001 From: Doug Neiner Date: Thu, 12 May 2011 01:51:05 -0400 Subject: Button: Added rtl detection so corner classes would properly be applied to buttonsets. Fixed #6796. jQueryui - buttonset on rtl --- ui/jquery.ui.button.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 031ac2091..06d2ad6bb 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -352,6 +352,8 @@ $.widget( "ui.buttonset", { }, refresh: function() { + var ltr = this.element.css( "direction" ) === "ltr"; + this.buttons = this.element.find( this.options.items ) .filter( ":ui-button" ) .button( "refresh" ) @@ -364,10 +366,10 @@ $.widget( "ui.buttonset", { }) .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) .filter( ":first" ) - .addClass( "ui-corner-left" ) + .addClass( ltr ? "ui-corner-left" : "ui-corner-right" ) .end() .filter( ":last" ) - .addClass( "ui-corner-right" ) + .addClass( ltr ? "ui-corner-right" : "ui-corner-left" ) .end() .end(); }, -- cgit v1.2.3