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

Selection working

This commit is contained in:
Artur Adib 2011-10-28 17:37:55 -04:00
parent 6c5d2ac88b
commit e7d08e3a98
4 changed files with 117 additions and 22 deletions

View file

@ -246,6 +246,12 @@ canvas {
line-height:1.3;
}
::selection { background:rgba(0,0,255,0.3); }
::-moz-selection { background:rgba(0,0,255,0.3); }
/* TODO: file FF bug to support ::-moz-selection:window-inactive
so we can override the opaque grey background when the window is inactive;
see also http://css-tricks.com/9288-window-inactive-styling */
#viewer {
margin: 44px 0px 0px;
padding: 8px 0px;

View file

@ -475,9 +475,9 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
canvas.mozOpaque = true;
div.appendChild(canvas);
var textDiv = document.createElement('div');
textDiv.className = 'textLayer';
div.appendChild(textDiv);
var textLayer = document.createElement('div');
textLayer.className = 'textLayer';
div.appendChild(textLayer);
var scale = this.scale;
canvas.width = pageWidth * scale;
@ -491,7 +491,7 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
ctx.translate(-this.x * scale, -this.y * scale);
stats.begin = Date.now();
this.content.startRendering(ctx, this.updateStats, textDiv, scale);
this.content.startRendering(ctx, this.updateStats, textLayer, scale);
setupLinks(this.content, this.scale);
div.setAttribute('data-loaded', true);