var elms = document.querySelectorAll('#divFontList > div');

for (var i = 0; i < elms.length; i++) {
    elms[i].addEventListener('click', function (e) {

        var elm = e.target.parentNode;
        var on = false;
        if (elm.className) {
            if (elm.className.indexOf('on') !== -1) {
                on = true;
            }
        }
        if (on) {
            parent._cb.clearFont();
        } else {
            var provider = elm.getAttribute('data-provider');
            var fontfamily = elm.getAttribute('data-font-family');
            var fontstyle = elm.getAttribute('data-font-style');
            var fontdisplay = elm.getAttribute('data-font-display');
            //parent._cb.applyFont(fontfamily, fontstyle, provider);
            parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);
        }
    });
}