cool#9992 doc sign: hide sign button when user pref doesn't provide cert or key #10247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Have no sign keys configured, open a document, go to the File tab on the
notebookbar, the signature button clutters the UI but it provides no
actual functionality.
The JS UI already got the private user info in Control.UIManager.js
onUpdateViews(), where we initialize the Zotero UI.
Do something similar for the sign UI: keep it enabled by default, but
once we learn about the private user info and it has no signing
key/cert, then hide the button.
The notebookbar gets re-initialized from time to time, so best to do
this via showButton(), which can remember which buttons are shown/hidden
and gets maintained even after a rebuild of the notebookbar. (The
postmessage API uses the same code to hide a button from an
integration.)
Signed-off-by: Miklos Vajna vmiklos@collabora.com
Change-Id: Ifad78220a002ed19a5d822d8affed9aea6073737