mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Introduce a generic selectEditors
helper function
This replaces the various copies of this logic with a single helper that we template for each editor type, similar to what we already do for the `switchToEditor` helper.
This commit is contained in:
parent
060ef0e15e
commit
f155b69c07
5 changed files with 16 additions and 28 deletions
|
@ -32,13 +32,13 @@ import {
|
|||
isVisible,
|
||||
kbBigMoveDown,
|
||||
kbBigMoveRight,
|
||||
kbSelectAll,
|
||||
kbUndo,
|
||||
loadAndWait,
|
||||
paste,
|
||||
pasteFromClipboard,
|
||||
scrollIntoView,
|
||||
selectEditor,
|
||||
selectEditors,
|
||||
serializeBitmapDimensions,
|
||||
switchToEditor,
|
||||
unselectEditor,
|
||||
|
@ -57,12 +57,7 @@ import { PNG } from "pngjs";
|
|||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const selectAll = async page => {
|
||||
await kbSelectAll(page);
|
||||
await page.waitForFunction(
|
||||
() => !document.querySelector(".stampEditor:not(.selectedEditor)")
|
||||
);
|
||||
};
|
||||
const selectAll = selectEditors.bind(null, "stamp");
|
||||
|
||||
const clearAll = async page => {
|
||||
await selectAll(page);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue