Widgets RTL fixes, props yoavf, fixes #16082
git-svn-id: http://svn.automattic.com/wordpress/trunk@18095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -4,7 +4,8 @@ var wpWidgets;
|
||||
wpWidgets = {
|
||||
|
||||
init : function() {
|
||||
var rem, sidebars = $('div.widgets-sortables');
|
||||
var rem, sidebars = $('div.widgets-sortables'), isRTL = !! ( 'undefined' != typeof isRtl && isRtl ),
|
||||
margin = ( isRtl ? 'marginRight' : 'marginLeft' );
|
||||
|
||||
$('#widgets-right').children('.widgets-holder-wrap').children('.sidebar-name').click(function(){
|
||||
var c = $(this).siblings('.widgets-sortables'), p = $(this).parent();
|
||||
@@ -34,14 +35,14 @@ wpWidgets = {
|
||||
if ( w > 250 && inside.closest('div.widgets-sortables').length ) {
|
||||
css['width'] = w + 30 + 'px';
|
||||
if ( inside.closest('div.widget-liquid-right').length )
|
||||
css['marginLeft'] = 235 - w + 'px';
|
||||
css[margin] = 235 - w + 'px';
|
||||
widget.css(css);
|
||||
}
|
||||
wpWidgets.fixLabels(widget);
|
||||
inside.slideDown('fast');
|
||||
} else {
|
||||
inside.slideUp('fast', function() {
|
||||
widget.css({'width':'','marginLeft':''});
|
||||
widget.css({'width':'', margin:''});
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -97,7 +98,7 @@ wpWidgets = {
|
||||
start: function(e,ui) {
|
||||
wpWidgets.fixWebkit(1);
|
||||
ui.item.children('.widget-inside').hide();
|
||||
ui.item.css({'marginLeft':'','width':''});
|
||||
ui.item.css({margin:'', 'width':''});
|
||||
},
|
||||
stop: function(e,ui) {
|
||||
if ( ui.item.hasClass('ui-draggable') && ui.item.data('draggable') )
|
||||
@@ -114,7 +115,7 @@ wpWidgets = {
|
||||
id = ui.item.attr('id'),
|
||||
sb = $(this).attr('id');
|
||||
|
||||
ui.item.css({'marginLeft':'','width':''});
|
||||
ui.item.css({margin:'', 'width':''});
|
||||
wpWidgets.fixWebkit();
|
||||
if ( add ) {
|
||||
if ( 'multi' == add ) {
|
||||
@@ -271,7 +272,7 @@ wpWidgets = {
|
||||
|
||||
close : function(widget) {
|
||||
widget.children('.widget-inside').slideUp('fast', function(){
|
||||
widget.css({'width':'','marginLeft':''});
|
||||
widget.css({'width':'', margin:''});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user