-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor] Add a z-index in order to draw them in the right order #15196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will clash with existing tab-indexes used elsewhere in the viewer, note the toolbars.
Hence it seems to me that we need to do something similar as in the annotationLayer and xfaLayer:
pdf.js/src/display/annotation_layer.js
Line 40 in 408c10b
const DEFAULT_TAB_INDEX = 1000; pdf.js/src/core/xfa/template.js
Line 125 in de7d1d2
const DEFAULT_TAB_INDEX = 5000;
How are tab-index and z-index related ? |
Sorry, trying to do two things at once and ended up completely misreading things! |
@@ -221,6 +225,7 @@ class AnnotationEditor { | |||
this.div.className = this.name; | |||
this.div.setAttribute("id", this.id); | |||
this.div.tabIndex = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where my previous comment applies.
src/display/editor/editor.js
Outdated
@@ -221,6 +225,7 @@ class AnnotationEditor { | |||
this.div.className = this.name; | |||
this.div.setAttribute("id", this.id); | |||
this.div.tabIndex = 0; | |||
this.div.style.zIndex = this.#zIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need both the static and the private member?
Could we not simply do the following instead:
this.div.style.zIndex = this.#zIndex; | |
this.div.style.zIndex = AnnotationEditor._zIndex++; |
The elements in the annotationEditor layer are rearranged to make them more accessible, but we must draw them in the order they have been created, hence this patch adds a z-index to the editors.
There was a bad interaction between this new z-index and the |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e548138bb1281cd/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c53a7a08a6826f8/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/e548138bb1281cd/output.txt Total script time: 4.62 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c53a7a08a6826f8/output.txt Total script time: 10.72 mins
|
The elements in the annotationEditor layer are rearranged to make them
more accessible, but we must draw them in the order they have been created,
hence this patch adds a z-index to the editors.