mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
The cssHook from addGetHookIf wasn't actually getting added
Conflicts: src/css.js
This commit is contained in:
parent
baa8dff023
commit
577df98524
@ -417,7 +417,7 @@ if ( !support.opacity ) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
addGetHookIf( jQuery.cssHooks.marginRight, support.reliableMarginRight,
|
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
|
||||||
function ( elem, computed ) {
|
function ( elem, computed ) {
|
||||||
if ( computed ) {
|
if ( computed ) {
|
||||||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
define(function() {
|
define(function() {
|
||||||
|
|
||||||
function addGetHookIf( hookVar, conditionFn, hookFn ) {
|
function addGetHookIf( conditionFn, hookFn ) {
|
||||||
// Define the hook, we'll check on the first run if it's really needed.
|
// Define the hook, we'll check on the first run if it's really needed.
|
||||||
hookVar = {
|
return {
|
||||||
get: function() {
|
get: function() {
|
||||||
var condition = conditionFn();
|
var condition = conditionFn();
|
||||||
|
|
||||||
@ -16,14 +16,13 @@ function addGetHookIf( hookVar, conditionFn, hookFn ) {
|
|||||||
// Hook not needed (or it's not possible to use it due to missing dependency),
|
// Hook not needed (or it's not possible to use it due to missing dependency),
|
||||||
// remove it.
|
// remove it.
|
||||||
// Since there are no other hooks for marginRight, remove the whole object.
|
// Since there are no other hooks for marginRight, remove the whole object.
|
||||||
delete hookVar.get;
|
delete this.get;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook needed; redefine it so that the support test is not executed again.
|
// Hook needed; redefine it so that the support test is not executed again.
|
||||||
hookVar.get = hookFn;
|
|
||||||
|
|
||||||
return hookVar.get.apply( hookVar, arguments );
|
return (this.get = hookFn).apply( hookVar, arguments );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( me
|
|||||||
// getComputedStyle returns percent when specified for top/left/bottom/right
|
// getComputedStyle returns percent when specified for top/left/bottom/right
|
||||||
// rather than make the css module depend on the offset module, we just check for it here
|
// rather than make the css module depend on the offset module, we just check for it here
|
||||||
jQuery.each( [ "top", "left" ], function( i, prop ) {
|
jQuery.each( [ "top", "left" ], function( i, prop ) {
|
||||||
addGetHookIf( jQuery.cssHooks[ prop ], support.pixelPosition,
|
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
|
||||||
function ( elem, computed ) {
|
function ( elem, computed ) {
|
||||||
if ( computed ) {
|
if ( computed ) {
|
||||||
computed = curCSS( elem, prop );
|
computed = curCSS( elem, prop );
|
||||||
|
Loading…
Reference in New Issue
Block a user