angular2-data-table
Version:
angular2-data-table is a Angular2 component for presenting large and complex data.
31 lines • 1.06 kB
JavaScript
;
var camel_case_1 = require('./camel-case');
var cache = {};
var testStyle = document.createElement('div').style;
// Get Prefix
// http://davidwalsh.name/vendor-prefix
var prefix = (function () {
var styles = window.getComputedStyle(document.documentElement, '');
var pre = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/))[1];
var dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
return {
dom: dom,
lowercase: pre,
css: "-" + pre + "-",
js: pre[0].toUpperCase() + pre.substr(1)
};
})();
function getVendorPrefixedName(property) {
var name = camel_case_1.camelCase(property);
if (!cache[name]) {
if (testStyle[prefix.css + property] !== undefined) {
cache[name] = prefix.css + property;
}
else if (testStyle[property] !== undefined) {
cache[name] = property;
}
}
return cache[name];
}
exports.getVendorPrefixedName = getVendorPrefixedName;
//# sourceMappingURL=prefixes.js.map