Pixel sanity check. props filosofo, fixes #13470.

git-svn-id: https://develop.svn.wordpress.org/trunk@14799 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-05-21 23:35:37 +00:00
parent 1ac33a73c0
commit 6d0ed6f1ea
3 changed files with 4 additions and 3 deletions

View File

@ -55,7 +55,8 @@ var wpNavMenu;
// jQuery extensions
$.fn.extend({
menuItemDepth : function() {
return api.pxToDepth( this.eq(0).css('margin-left').slice(0, -2) );
var margin = this.eq(0).css('margin-left');
return api.pxToDepth( margin && -1 != margin.indexOf('px') ? margin.slice(0, -2) : 0 );
},
updateDepthClass : function(current, prev) {
return this.each(function(){

File diff suppressed because one or more lines are too long

View File

@ -384,7 +384,7 @@ function wp_default_scripts( &$scripts ) {
) );
// Custom Navigation
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100520a' );
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100521' );
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
'home' => _x('Home', 'nav menu home label'),
'homeurl' => home_url('/'),