From 727d51ec9df1dadd742fc468ca3e003da172fb1b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 16 Aug 2011 19:25:32 -0400 Subject: [PATCH] Save a few bytes, thanks @danheberden! --- src/css.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css.js b/src/css.js index da0dd20c8..e5a93fce1 100644 --- a/src/css.js +++ b/src/css.js @@ -6,7 +6,7 @@ var ralpha = /alpha\([^)]*\)/i, rupper = /([A-Z]|^ms)/g, rnumpx = /^-?\d+(?:px)?$/i, rnum = /^-?\d/, - rrelNum = /^([+\-])=([+\-\.\de]+)/, + rrelNum = /^([-+])=([-+.\de]+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssWidth = [ "Left", "Right" ], @@ -85,7 +85,7 @@ jQuery.extend({ // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = (ret[1] === "+"? +ret[2] : -ret[2]) + parseFloat( jQuery.css( elem, name ) ); + value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } -- 2.39.5