Skip to content

Commit

Permalink
Merge pull request #893 from kossebau/disableCustomButtonsWithoutSession
Browse files Browse the repository at this point in the history
Disable custom buttons save/saveAs/close/download when there is no session
  • Loading branch information
Friedrich committed May 20, 2015
2 parents d75f262 + 4ed6c50 commit 5d7858f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Changes between 0.5.7 and 0.5.8

## Wodo.TextEditor

### Fixes

* Disable custom buttons save/saveAs/close/download when there is no session ([#893](https://github.com/kogmbh/WebODF/pull/893))


# Changes between 0.5.6 and 0.5.7

## WebODF
Expand Down
13 changes: 10 additions & 3 deletions programs/editor/Tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ define("webodf/editor/Tools", [
sessionSubscribers.forEach(function (subscriber) {
subscriber.setEditorSession(editorSession);
});
if (formatMenuButton) {
formatMenuButton.setAttribute('disabled', !editorSession);
}

[saveButton, saveAsButton, downloadButton, closeButton, formatMenuButton].forEach(function (button) {
if (button) {
button.setAttribute('disabled', !editorSession);
}
});
}

this.setEditorSession = setEditorSession;
Expand Down Expand Up @@ -171,6 +174,7 @@ define("webodf/editor/Tools", [
saveButton = new Button({
label: tr('Save'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconSave',
onClick: function () {
saveOdtFile();
Expand All @@ -185,6 +189,7 @@ define("webodf/editor/Tools", [
saveAsButton = new Button({
label: tr('Save as...'),
showLabel: false,
disabled: true,
iconClass: 'webodfeditor-dijitSaveAsIcon',
onClick: function () {
saveAsOdtFile();
Expand All @@ -199,6 +204,7 @@ define("webodf/editor/Tools", [
downloadButton = new Button({
label: tr('Download'),
showLabel: true,
disabled: true,
style: {
float: 'right'
},
Expand Down Expand Up @@ -267,6 +273,7 @@ define("webodf/editor/Tools", [
closeButton = new Button({
label: tr('Close'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
style: {
float: 'right'
Expand Down

0 comments on commit 5d7858f

Please sign in to comment.