Hype DataFill 1.2.2
Allowing for things like mapping data-bgcolor to the class .bgcolor and firing a custom callback when the data-bgcolor changes or is set.
// map based on class hence data-headline --> .headline with default innerHTML callback
HypeDataFill.mapDatasetToClass('headline');
// map based on class hence data-bgcolor --> .bgcolor with custom callback
HypeDataFill.mapDatasetToClass('bgcolor', function(elm, value){
elm.style.backgroundColor = value;
});
// map based on selector with default innerHTML callback
HypeDataFill.mapDatasetToSelector('price', '.only.here', function(elm, value){
elm.innerHTML = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(value);
});
The Latest update was inspired by Mark Hunt from Tumult forums adding custom callbacks!
Also, I modified the read me and switched to semantic versioning. Minor update to observe class changes in IDE.