From f529aef82d25fb8e60449fae60ca6acdb4fc1d36 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 28 Feb 2008 09:11:11 +0000 Subject: [PATCH] Widget admin layout fixes from mdawaffe. fixes #5997 git-svn-id: http://svn.automattic.com/wordpress/trunk@7086 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/widgets-rtl.css | 7 +++++++ wp-admin/css/widgets.css | 7 +++++-- wp-admin/includes/widgets.php | 6 +++--- wp-admin/js/widgets.js | 23 +++++++++++++++++++---- wp-includes/js/wp-lists.js | 1 + 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css index c2034b4f8f..9aa277ede0 100644 --- a/wp-admin/css/widgets-rtl.css +++ b/wp-admin/css/widgets-rtl.css @@ -34,6 +34,13 @@ h4.widget-title a { right: auto; } +li.widget-list-control-item h4.widget-title a, +#dragHelper li.widget-list-control-item h4.widget-title a, +#draghelper li.widget-list-control-item h4.widget-title a:visited { + right: auto; + left: 2em; +} + li.widget-list-control-item div.widget-control { padding: 0 0 0 10px; } diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css index 76884d8f9c..6df7ff521e 100644 --- a/wp-admin/css/widgets.css +++ b/wp-admin/css/widgets.css @@ -14,6 +14,7 @@ div.widget-liquid-right { float: right; clear: right; width: 300px; + position: relative; } /* pasitioning etc. */ @@ -95,7 +96,6 @@ li.widget-list-control-item { } li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 { - position: relative; margin: 0; background-color: #2683ae; padding: .5em 1em; @@ -113,8 +113,11 @@ h4.widget-title a { border-bottom: none; } -li.widget-list-control-item h4.widget-title a, li.widget-list-control-item h4.widget-title a:visited { +li.widget-list-control-item h4.widget-title a, +#dragHelper li.widget-list-control-item h4.widget-title a, +#draghelper li.widget-list-control-item h4.widget-title a:visited { color: #fff; + right: 2em; } li.widget-list-control-item h4.widget-title a:hover { diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index c9ca05fb28..fed840451b 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -63,12 +63,12 @@ function wp_list_widgets( $show = 'all', $_search = false ) { ) ), "add-widget_$widget[id]" ); } else { $action = 'edit'; - $edit_url = add_query_arg( array( + $edit_url = clean_url( add_query_arg( array( 'sidebar' => $sidebar, 'edit' => $widget['id'], 'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ), - ) ); - $widget_control_template = ''; + ) ) ); + $widget_control_template = '
  • '; } $no_widgets_shown = false; diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index b524786f0f..a2e83c079d 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -6,20 +6,35 @@ jQuery(function($) { // Open or close widget control form var toggleWidget = function( li ) { var width = li.find('input.widget-width').val(); - return li.children('div.widget-control').each( function() { + + // it seems IE chokes on these animations because of the positioning/floating + var widgetAnim = $.browser.msie ? function() { var t = $(this); if ( t.is(':visible') ) { - t.animate( { height: 'hide' } ); + li.css( 'marginLeft', 0 ); + t.siblings('h4').children('a').text( widgetsL10n.edit ); + } else { + if ( width > 250 ) + li.css( 'marginLeft', ( width - 250 ) * -1 ); + t.siblings('h4').children('a').text( widgetsL10n.cancel ); + } + t.toggle(); + } : function() { + var t = $(this); + + if ( t.is(':visible') ) { if ( width > 250 ) li.animate( { marginLeft: 0 } ); t.siblings('h4').children('a').text( widgetsL10n.edit ); } else { - t.animate( { height: 'show' } ); if ( width > 250 ) li.animate( { marginLeft: ( width - 250 ) * -1 } ); t.siblings('h4').children('a').text( widgetsL10n.cancel ); } - } ).end(); + t.animate( { height: 'toggle' } ); + }; + + return li.children('div.widget-control').each( widgetAnim ).end(); }; // onclick for edit links diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index e7e81ab19d..bbff26c516 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -8,6 +8,7 @@ wpAjax = { var q = s.split('?'); if ( q[1] ) { s = q[1]; } var pp = s.split('&'); for ( var i in pp ) { + if ( $.isFunction(pp.hasOwnProperty) && !pp.hasOwnProperty(i) ) { continue; } var p = pp[i].split('='); r[p[0]] = p[1]; }