Fix lag when opening help tab if screen options was opened before, fixes #19172

git-svn-id: http://svn.automattic.com/wordpress/trunk@19186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-06 18:18:45 +00:00
parent ab5f3aa79c
commit 8284ef87fb
3 changed files with 12 additions and 8 deletions

View File

@ -124,18 +124,22 @@ screenMeta = {
panel.parent().show();
panel.slideDown( 'fast', function() {
link.addClass('screen-meta-active');
screenMeta.refresh();
});
screenMeta.refresh();
},
refresh: function( panel, link ) {
var columns = $('#contextual-help-wrap').children(), height;
var columns = $('#contextual-help-wrap').children(), height = 0;
columns.height('auto');
columns.each(function(){
var h = $(this).height();
height = Math.max.apply( null, $.map( columns, function( el ) { return $(el).height(); }) );
columns.height( height );
if ( h > height )
height = h;
});
if ( height )
columns.height( height );
},
close: function( panel, link ) {

File diff suppressed because one or more lines are too long

View File

@ -61,7 +61,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111103b', 1 );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111106', 1 );
$scripts->add_script_data( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.")
) );