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

Disable custom buttons save/saveAs/close/download when there is no session #893

Merged
merged 1 commit into from
May 20, 2015

Conversation

kossebau
Copy link
Contributor

Makes at least sense for all use cases I know currently.

Future versions of Wodo UI (as planned with closure lib) should give more control of those buttons to the developers, of course. But for now this is a small but useful fix with the current simple support for those custom buttons.

@kogmbh-ci
Copy link

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/2361/

formatMenuButton.setAttribute('disabled', !editorSession);
}

[saveButton, saveAsButton, downloadButton, closeButton, formatMenuButton].forEach(function (button) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The open button should perhaps be fixed as well? Currently, if I supply a link to a non-existent document, then click open it throws an assertion 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is at least one usecase where the editor is started without any session, and the open button (+ passed callback) is used to select a file that should be loaded into the editor. So it needs to be active also without a session.
So you possible found a bug in the callback handler passed for the Open button. Which code is that? localeditor.html?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Local editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. But that is an independent error, no? No proper handling of failed loading of documents yet :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question I haven't bothered to investigate. Just noticed whilst poking this PR 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as #894 :)

@peitschie
Copy link
Contributor

Buttons appear to disable and enable fine for me. :shipit: !

@kossebau
Copy link
Contributor Author

Thanks for review, @peitschie !

kossebau pushed a commit that referenced this pull request May 20, 2015
Disable custom buttons save/saveAs/close/download when there is no session
@kossebau kossebau merged commit 5d7858f into webodf:master May 20, 2015
@kossebau kossebau deleted the disableCustomButtonsWithoutSession branch May 20, 2015 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants