examples/todo/js/behaviors/todo.js
function getClosestTodoElement(element) {

		var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector;

		while (element) {
			if (matchesSelector.bind(element)('li')) {
				return element;
			} else {
				element = element.parentNode;
			}
		}
		return false;

	}
function getClosestTodoElement(element) {

		var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector;

		while (element) {
			if (matchesSelector.bind(element)('li')) {
				return element;
			} else {
				element = element.parentNode;
			}
		}
		return false;

	}
function getClosestTodoElement ( element ) { var matchesSelector = element . matches || element . webkitMatchesSelector || element . mozMatchesSelector || element . msMatchesSelector ; while ( element ) { if ( matchesSelector . bind ( element ) ( 'li' ) ) { return element ; } else { element = element . parentNode ; } } return false ; }
Returns the nearest todo element
@param {HTMLElement} element A root/child node of a todo element to search from
@returns {HTMLElement}
@private
Returns the nearest todo element