]> source.dussan.org Git - jquery.git/commitdiff
Revert "Offset: Send px-ed strings to .css()"
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 20 Jul 2020 19:29:40 +0000 (21:29 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 19:29:40 +0000 (21:29 +0200)
The way warning against number values in `.css()` setters was done in
jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348
there's no need to send px-ed strings for `top` & `left` as they already
don't get the "px" suffix.

This reverts commit 57038faebc6ece5bd666c28303f8a91ff59153eb.

Closes gh-4753
Ref jquery/jquery-migrate/pull/337
Ref jquery/jquery-migrate/pull/348

src/offset.js

index 62166bc9999f37838abf3544aa62876cfcc25727..6e973587062b47e09a5e5bcc58bf2e1988bad5a3 100644 (file)
@@ -63,12 +63,6 @@ jQuery.offset = {
                        options.using.call( elem, props );
 
                } else {
-                       if ( typeof props.top === "number" ) {
-                               props.top += "px";
-                       }
-                       if ( typeof props.left === "number" ) {
-                               props.left += "px";
-                       }
                        curElem.css( props );
                }
        }