js/app.js
//Delegate according to id or data - command pattern in Java
Delegate according to id or data - command pattern in Java
Delegate according to id or data - command pattern in Java
function _controlPanelClick(event) {
	var el = event.target;
	if (_controlHandler[el.id] != null) {
		if (_validateHandler[el.id](event)) _controlHandler[el.id](event);
	}
	if (_controlHandler[el.getAttribute('data-action')] != null) {
		if (el.getAttribute('data-action') == 'colorSelect') {
			return;
		}
		if (_validateHandler[el.getAttribute('data-action')](event)) _controlHandler[el.getAttribute('data-action')](event);
	}
}
function _controlPanelClick ( event ) { var el = event . target ; if ( _controlHandler [ el . id ] != null ) { if ( _validateHandler [ el . id ] ( event ) ) _controlHandler [ el . id ] ( event ) ; } if ( _controlHandler [ el . getAttribute ( 'data-action' ) ] != null ) { if ( el . getAttribute ( 'data-action' ) == 'colorSelect' ) { return ; } if ( _validateHandler [ el . getAttribute ( 'data-action' ) ] ( event ) ) _controlHandler [ el . getAttribute ( 'data-action' ) ] ( event ) ; } }
Delegate according to id or data - command pattern in Java
Delegate according to id or data - command pattern in Java
//TODO: Rely on data-action only