UNPKG

tat

Version:
32 lines (25 loc) 729 B
/** * This file is used in conjunction with Jymin to form the Tat client. * * If you're already using Jymin, you can use this file with it. * Otherwise use ../tat-client.js which includes the required Jymin functions. */ /** * Tat is a function that accepts new tags. */ var Tat = window.Tat = function (newTags) { var tags = Tat._tags = Tat._tags || {}; var tagNames = []; Jymin.forIn(newTags, function (name, tag) { tags[name] = tag; tagNames = []; }); // Upon receiving tags, iterate over them and render their contents. var selector = tagNames.join(name); Jymin.all(selector, function (element) { }); if (!Tat.isReady) { Tat._isReady = true; Jymin.trigger(Tat, 'ready'); } };