Widget admin layout fixes from mdawaffe. fixes #5997

git-svn-id: http://svn.automattic.com/wordpress/trunk@7086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-28 09:11:11 +00:00
parent 67fd73834b
commit f529aef82d
5 changed files with 35 additions and 9 deletions

View File

@ -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;
}

View File

@ -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 {

View File

@ -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 = '<textarea>' . htmlspecialchars( $widget_control_template ) . '</textarea>';
) ) );
$widget_control_template = '<li><textarea rows="1" cols="1">' . htmlspecialchars( $widget_control_template ) . '</textarea></li>';
}
$no_widgets_shown = false;

View File

@ -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

View File

@ -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];
}