corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | define(function() { |
2 | |||
3 | function addGetHookIf( conditionFn, hookFn ) { |
||
4 | // Define the hook, we'll check on the first run if it's really needed. |
||
5 | return { |
||
6 | get: function() { |
||
7 | if ( conditionFn() ) { |
||
8 | // Hook not needed (or it's not possible to use it due to missing dependency), |
||
9 | // remove it. |
||
10 | // Since there are no other hooks for marginRight, remove the whole object. |
||
11 | delete this.get; |
||
12 | return; |
||
13 | } |
||
14 | |||
15 | // Hook needed; redefine it so that the support test is not executed again. |
||
16 | |||
17 | return (this.get = hookFn).apply( this, arguments ); |
||
18 | } |
||
19 | }; |
||
20 | } |
||
21 | |||
22 | return addGetHookIf; |
||
23 | |||
24 | }); |