mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #949 from notmasteryet/ie9-dataset
Add compatibility for HTMLElement's dataset
This commit is contained in:
commit
0226405b86
1 changed files with 12 additions and 0 deletions
|
@ -205,3 +205,15 @@
|
|||
});
|
||||
})();
|
||||
|
||||
// HTMLElement dataset property
|
||||
(function checkDatasetProperty() {
|
||||
var div = document.createElement('div');
|
||||
if ('dataset' in div)
|
||||
return; // dataset property exists
|
||||
Object.defineProperty(HTMLElement.prototype, 'dataset', {
|
||||
get: function htmlElementDatasetGetter() {
|
||||
// adding dataset field to the actual object
|
||||
return (this.dataset = {});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue