Merge pull request #7539 from jeremypress/fairexpand
[api-minor] Expanding divs to improve selection
This commit is contained in:
commit
6bb95e3129
9 changed files with 460 additions and 38 deletions
|
@ -76,6 +76,8 @@ var DEFAULT_CACHE_SIZE = 10;
|
|||
* queue object.
|
||||
* @property {boolean} removePageBorders - (optional) Removes the border shadow
|
||||
* around the pages. The default is false.
|
||||
* @property {boolean} enhanceTextSelection - (optional) Enables the improved
|
||||
* text selection behaviour. The default is `false`.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -127,6 +129,7 @@ var PDFViewer = (function pdfViewer() {
|
|||
this.linkService = options.linkService || new SimpleLinkService();
|
||||
this.downloadManager = options.downloadManager || null;
|
||||
this.removePageBorders = options.removePageBorders || false;
|
||||
this.enhanceTextSelection = options.enhanceTextSelection || false;
|
||||
|
||||
this.defaultRenderingQueue = !options.renderingQueue;
|
||||
if (this.defaultRenderingQueue) {
|
||||
|
@ -352,7 +355,8 @@ var PDFViewer = (function pdfViewer() {
|
|||
defaultViewport: viewport.clone(),
|
||||
renderingQueue: this.renderingQueue,
|
||||
textLayerFactory: textLayerFactory,
|
||||
annotationLayerFactory: this
|
||||
annotationLayerFactory: this,
|
||||
enhanceTextSelection: this.enhanceTextSelection,
|
||||
});
|
||||
bindOnAfterAndBeforeDraw(pageView);
|
||||
this._pages.push(pageView);
|
||||
|
@ -836,13 +840,16 @@ var PDFViewer = (function pdfViewer() {
|
|||
* @param {PageViewport} viewport
|
||||
* @returns {TextLayerBuilder}
|
||||
*/
|
||||
createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport) {
|
||||
createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport,
|
||||
enhanceTextSelection) {
|
||||
return new TextLayerBuilder({
|
||||
textLayerDiv: textLayerDiv,
|
||||
eventBus: this.eventBus,
|
||||
pageIndex: pageIndex,
|
||||
viewport: viewport,
|
||||
findController: this.isInPresentationMode ? null : this.findController
|
||||
findController: this.isInPresentationMode ? null : this.findController,
|
||||
enhanceTextSelection: this.isInPresentationMode ? false :
|
||||
enhanceTextSelection,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue