mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Add support for horizontal scrolling in 'scrollIntoView' in ui_utils.js
This commit is contained in:
parent
1d276b0396
commit
736c570231
2 changed files with 22 additions and 7 deletions
|
@ -13,10 +13,12 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals CustomStyle, PDFFindController, scrollIntoView */
|
||||
|
||||
'use strict';
|
||||
|
||||
/* globals CustomStyle, PDFFindController, scrollIntoView */
|
||||
var FIND_SCROLL_OFFSET_TOP = -50;
|
||||
var FIND_SCROLL_OFFSET_LEFT = -400;
|
||||
|
||||
/**
|
||||
* TextLayerBuilder provides text-selection
|
||||
|
@ -310,7 +312,8 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
var isSelected = isSelectedPage && i === selectedMatchIdx;
|
||||
var highlightSuffix = (isSelected ? ' selected' : '');
|
||||
if (isSelected && !this.isViewerInPresentationMode) {
|
||||
scrollIntoView(textDivs[begin.divIdx], { top: -50 });
|
||||
scrollIntoView(textDivs[begin.divIdx], { top: FIND_SCROLL_OFFSET_TOP,
|
||||
left: FIND_SCROLL_OFFSET_LEFT });
|
||||
}
|
||||
|
||||
// Match inside new div.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue