Skip to content
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

How to disable toolbar buttons at will? #2611

Closed
jaimeloci opened this issue Jan 25, 2013 · 9 comments
Closed

How to disable toolbar buttons at will? #2611

jaimeloci opened this issue Jan 25, 2013 · 9 comments

Comments

@jaimeloci
Copy link

I have downloaded the example in http://mozilla.github.com/pdf.js/web/viewer.html and all the assets. Everything works fine. But now I'm trying to disable certain buttons to limit the functions a user has. I have tried commenting out individual buttons in the HTML code -even the div.toolbar layer- but the page doesn't load.

What should I do to accomplish that? Thanks!

@Snuffleupagus
Copy link
Collaborator

Do you want to completely disable a button, or would if suffice if it's not visible?
If the latter is true, all you need to do is add hidden to the class attribute of the button's HTML tag.

@jaimeloci
Copy link
Author

Disabling completely

@yurydelendik
Copy link
Contributor

Looks like your issue is out-of-scope of this project. If you are removing HTML elements from viewer.js, you have to remove code that using them in the viewer.js, e.g. if 'next' button is removed, the line https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L2880 must be removed as well. Closing as invalid

@ztraboo
Copy link

ztraboo commented Jun 18, 2015

I would like to removed the button "download" from the PDF JS viewer too. Is there a way to do that instead of just included the hidden to the class attribute of the button's HTML tag?

@timvandermeij
Copy link
Contributor

You can remove the entire HTML element and all associated download code (in viewer.js).

@ztraboo
Copy link

ztraboo commented Jun 18, 2015

@timvandermeij,
Can you tell me what lines that I would need to remove in viewer.js to remove the button element with "download" id? I'm doing this now and test the code out.

@timvandermeij
Copy link
Contributor

Looks fine to me.

@perguth
Copy link

perguth commented Jul 7, 2015

Looks like your issue is out-of-scope of this project. [...] Closing as invalid

@yurydelendik I applaud, really. The prevalent willingness to work against the open web is scary.

@mozilla mozilla locked and limited conversation to collaborators Jul 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants