summaryrefslogtreecommitdiffstats
path: root/js/vendor/jquery/src/css/addGetHookIf.js
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-15 04:36:40 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-15 04:36:40 +0200
commit04e421cf2f4f801d7e5e6b1fbdb8221855ad4613 (patch)
tree4a5e0b5a447ed75813fd4ef92c35f2e2fb4f1ac8 /js/vendor/jquery/src/css/addGetHookIf.js
parentadb9dfeb350bdb92e998fefc2827ffe8b58256a2 (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.js24
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;
+
+});