diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 04:36:40 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 04:36:40 +0200 |
commit | 04e421cf2f4f801d7e5e6b1fbdb8221855ad4613 (patch) | |
tree | 4a5e0b5a447ed75813fd4ef92c35f2e2fb4f1ac8 /js/vendor/jquery/src/css/addGetHookIf.js | |
parent | adb9dfeb350bdb92e998fefc2827ffe8b58256a2 (diff) |
add basic files for js rewrite
Diffstat (limited to 'js/vendor/jquery/src/css/addGetHookIf.js')
-rw-r--r-- | js/vendor/jquery/src/css/addGetHookIf.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/vendor/jquery/src/css/addGetHookIf.js b/js/vendor/jquery/src/css/addGetHookIf.js new file mode 100644 index 000000000..81d694cb0 --- /dev/null +++ b/js/vendor/jquery/src/css/addGetHookIf.js @@ -0,0 +1,24 @@ +define(function() { + +function addGetHookIf( conditionFn, hookFn ) { + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + // 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 this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + + return (this.get = hookFn).apply( this, arguments ); + } + }; +} + +return addGetHookIf; + +}); |