The cssHook from addGetHookIf wasn't actually getting added

Conflicts:
	src/css.js
This commit is contained in:
Timmy Willison
2013-09-11 08:41:48 -05:00
parent baa8dff023
commit 577df98524
3 changed files with 6 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
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.
hookVar = {
return {
get: function() {
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),
// remove it.
// Since there are no other hooks for marginRight, remove the whole object.
delete hookVar.get;
delete this.get;
return;
}
// 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 );
}
};
}