1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00

Merge branch 'master' of git://github.com/mozilla/pdf.js into sidebar-pinning

This commit is contained in:
gigaherz 2012-02-13 09:35:46 +01:00
commit 349e0b9d47
3 changed files with 9 additions and 6 deletions

View file

@ -217,12 +217,15 @@
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 = {});
var oldCreateElement = document.createElement;
document.createElement = function newCreateElement() {
var result = oldCreateElement.apply(document, arguments);
if (arguments[0] === 'div') {
// creating dataset property for the div elements
result.dataset = {};
}
});
return result;
};
})();
// Check console compatability

View file

@ -271,6 +271,7 @@ canvas {
right: 0;
bottom: 0;
color: #000;
font-family: sans-serif;
}
.textLayer > div {

View file

@ -1087,7 +1087,6 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
textDiv.dataset.canvasWidth = text.canvasWidth * text.geom.hScale;
textDiv.style.fontSize = fontHeight + 'px';
textDiv.style.fontFamily = fontName || 'sans-serif';
textDiv.style.left = text.geom.x + 'px';
textDiv.style.top = (text.geom.y - fontHeight) + 'px';
textDiv.textContent = text.str;