example/ViewManager.js
function fetchView( data, id ) {

	data.backgroundColor = randomCol();
	data.fontColour		 = data.backgroundImage? '' : getContrastYIQ( data.backgroundColor );

	let wrapper 		= document.createElement('div');
	wrapper.className 	= 'section hidden';
	wrapper.innerHTML 	= SimpleViewTemplate( data );
	wrapper.dataset.id  = id;

	container.appendChild( wrapper );
	return wrapper;
}
function fetchView( data, id ) {

	data.backgroundColor = randomCol();
	data.fontColour		 = data.backgroundImage? '' : getContrastYIQ( data.backgroundColor );

	let wrapper 		= document.createElement('div');
	wrapper.className 	= 'section hidden';
	wrapper.innerHTML 	= SimpleViewTemplate( data );
	wrapper.dataset.id  = id;

	container.appendChild( wrapper );
	return wrapper;
}
function fetchView ( data , id ) { data . backgroundColor = randomCol ( ) ; data . fontColour = data . backgroundImage ? '' : getContrastYIQ ( data . backgroundColor ) ; let wrapper = document . createElement ( 'div' ) ; wrapper . className = 'section hidden' ; wrapper . innerHTML = SimpleViewTemplate ( data ) ; wrapper . dataset . id = id ; container . appendChild ( wrapper ) ; return wrapper ; }
create and apped a new View
to the DOM prepoppulating with
view data
@param  {object} data
@param  {int} id - incremented ID
@return {Node}
create and apped a new View to the DOM prepoppulating with view data