-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Convert the hand tool to a class #7207
Conversation
|
||
if (this.toggleHandTool) { | ||
this.toggleHandTool.addEventListener('click', this.toggle.bind(this), | ||
false); |
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.
According to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters, false
is the default here, so can't we just remove that?
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.
Done in the new commit.
3170fa2
to
4cbb872
Compare
function HandTool(options) { | ||
this.container = options.container; | ||
this.toggleHandTool = options.toggleHandTool; | ||
|
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.
Since we usually add all the various members, with suitable defaults, when initializing classes, you may want to add this.wasActive
here as well. Please refer to the {enter,exit}PresentationMode
code.
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.
Done in the new commit. It was also a bit weird that the value of the member variable was either true
or null
, so I changed that to true
and false
.
You need to update https://github.com/mozilla/pdf.js/blob/master/web/app.js#L2151 as well, otherwise pressing H throws an error. r=me, with the above comments and questions answered/fixed. Thank you for doing this! (Also, I'd really like to get rid of e.g. the |
4cbb872
to
8812ca5
Compare
The shortcut line has also been updated. |
8812ca5
to
b0aca31
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a2ec67e382692be/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a2ec67e382692be/output.txt Total script time: 0.98 mins Published |
Thank you for reviewing this, @Snuffleupagus! |
Furthermore we add more comments to the file.