locize
Version:
This package adds the incontext editor to your i18next setup.
32 lines (29 loc) • 752 B
JavaScript
;
(function () {
if (typeof Document === 'undefined') return;
var nextID = 1;
if (Document.prototype.hasOwnProperty('uniqueID')) {
return;
}
console.info('"document.uniqueID" not implemented; creating shim');
Object.defineProperty(Document.prototype, 'uniqueID', {
get: function get() {
return nextID++;
},
enumerable: false,
configurable: false
});
Object.defineProperty(Element.prototype, 'uniqueID', {
get: function get() {
Object.defineProperty(this, 'uniqueID', {
value: document.uniqueID,
writable: false,
enumerable: false,
configurable: false
});
return this.uniqueID;
},
enumerable: false,
configurable: true
});
})();