Blame view
app/bower_components/jquery/src/css/addGetHookIf.js
530 Bytes
87c93a029
|
1 2 3 |
define( function() { "use strict"; |
f986e111b
|
4 5 |
function addGetHookIf( conditionFn, hookFn ) { |
87c93a029
|
6 |
|
f986e111b
|
7 8 9 |
// Define the hook, we'll check on the first run if it's really needed. return { get: function() { |
87c93a029
|
10 |
if ( conditionFn() ) { |
f986e111b
|
11 |
|
87c93a029
|
12 13 |
// Hook not needed (or it's not possible to use it due // to missing dependency), remove it. |
f986e111b
|
14 15 16 17 18 |
delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. |
87c93a029
|
19 |
return ( this.get = hookFn ).apply( this, arguments ); |
f986e111b
|
20 21 22 23 24 |
} }; } return addGetHookIf; |
87c93a029
|
25 |
} ); |