Blame view

bower_components/jquery/src/css/addGetHookIf.js 509 Bytes
c5169e0e   Renato De Donato   a new hope
1
  define(function() {
74249687   Luigi Serra   Cross browser con...
2
3
  
  function addGetHookIf( conditionFn, hookFn ) {
74249687   Luigi Serra   Cross browser con...
4
5
6
7
  	// Define the hook, we'll check on the first run if it's really needed.
  	return {
  		get: function() {
  			if ( conditionFn() ) {
74249687   Luigi Serra   Cross browser con...
8
9
10
11
12
13
14
  				// 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.
c5169e0e   Renato De Donato   a new hope
15
  			return (this.get = hookFn).apply( this, arguments );
74249687   Luigi Serra   Cross browser con...
16
17
18
19
20
21
  		}
  	};
  }
  
  return addGetHookIf;
  
c5169e0e   Renato De Donato   a new hope
22
  });