module.exports = {
matches: function(el, selector) {
var method;
method = el.matches || el.mozMatchesSelector || el.msMatchesSelector || el.oMatchesSelector || el.webkitMatchesSelector;
return method != null ? method.call(el, selector) : void 0;
},
closest: function(el, selector) {
if (!el) {
return null;
}
if (this.matches(el, selector)) {
return el;
} else {
return this.closest(el.parentNode, selector);
}
},
readBootstrapData: function(root) {
var el;
Iif (root == null) {
root = document;
}
el = root.querySelector('#tutor-boostrap-data');
Eif (el) {
el.parentNode.removeChild(el);
return JSON.parse(el.textContent);
} else {
return {};
}
}
};
|