Blame view

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