js/jRespond.js
function() {

			var enterArray = [];
			var exitArray = [];

			for (var i = 0; i < mediaListeners.length; i++) {
				var brkpt = mediaListeners[i]['breakpoint'];
				var entr = mediaListeners[i]['enter'] || undefined;
				var exit = mediaListeners[i]['exit'] || undefined;

				if (brkpt === '*') {
					if (entr !== undefined) {
						enterArray.push(entr);
					}
					if (exit !== undefined) {
						exitArray.push(exit);
					}
				} else if (testForCurr(brkpt)) {
					if (entr !== undefined && !mediaInit[i]) {
						enterArray.push(entr);
					}
					mediaInit[i] = true;
				} else {
					if (exit !== undefined && mediaInit[i]) {
						exitArray.push(exit);
					}
					mediaInit[i] = false;
				}
			}

			var eventObject = {
				entering : curr,
				exiting : prev
			};

			// loop through exit functions to call
			for (var j = 0; j < exitArray.length; j++) {
				exitArray[j].call(null, eventObject);
			}

			// then loop through enter functions to call
			for (var k = 0; k < enterArray.length; k++) {
				enterArray[k].call(null, eventObject);
			}
		}
function() {

			var enterArray = [];
			var exitArray = [];

			for (var i = 0; i < mediaListeners.length; i++) {
				var brkpt = mediaListeners[i]['breakpoint'];
				var entr = mediaListeners[i]['enter'] || undefined;
				var exit = mediaListeners[i]['exit'] || undefined;

				if (brkpt === '*') {
					if (entr !== undefined) {
						enterArray.push(entr);
					}
					if (exit !== undefined) {
						exitArray.push(exit);
					}
				} else if (testForCurr(brkpt)) {
					if (entr !== undefined && !mediaInit[i]) {
						enterArray.push(entr);
					}
					mediaInit[i] = true;
				} else {
					if (exit !== undefined && mediaInit[i]) {
						exitArray.push(exit);
					}
					mediaInit[i] = false;
				}
			}

			var eventObject = {
				entering : curr,
				exiting : prev
			};

			// loop through exit functions to call
			for (var j = 0; j < exitArray.length; j++) {
				exitArray[j].call(null, eventObject);
			}

			// then loop through enter functions to call
			for (var k = 0; k < enterArray.length; k++) {
				enterArray[k].call(null, eventObject);
			}
		}
function ( ) { var enterArray = [ ] ; var exitArray = [ ] ; for ( var i = 0 ; i < mediaListeners . length ; i ++ ) { var brkpt = mediaListeners [ i ] [ 'breakpoint' ] ; var entr = mediaListeners [ i ] [ 'enter' ] || undefined ; var exit = mediaListeners [ i ] [ 'exit' ] || undefined ; if ( brkpt === '*' ) { if ( entr !== undefined ) { enterArray . push ( entr ) ; } if ( exit !== undefined ) { exitArray . push ( exit ) ; } } else if ( testForCurr ( brkpt ) ) { if ( entr !== undefined && ! mediaInit [ i ] ) { enterArray . push ( entr ) ; } mediaInit [ i ] = true ; } else { if ( exit !== undefined && mediaInit [ i ] ) { exitArray . push ( exit ) ; } mediaInit [ i ] = false ; } } var eventObject = { entering : curr , exiting : prev } ; // loop through exit functions to call for ( var j = 0 ; j < exitArray . length ; j ++ ) { exitArray [ j ] . call ( null , eventObject ) ; } // then loop through enter functions to call for ( var k = 0 ; k < enterArray . length ; k ++ ) { enterArray [ k ] . call ( null , eventObject ) ; } }
loops through all registered functions and determines what should be fired
loops through all registered functions and determines what should be fired