Skip to content

Commit 5d7858f

Browse files
author
Friedrich
committed
Merge pull request #893 from kossebau/disableCustomButtonsWithoutSession
Disable custom buttons save/saveAs/close/download when there is no session
2 parents d75f262 + 4ed6c50 commit 5d7858f

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

ChangeLog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Changes between 0.5.7 and 0.5.8
2+
3+
## Wodo.TextEditor
4+
5+
### Fixes
6+
7+
* Disable custom buttons save/saveAs/close/download when there is no session ([#893](https://github.com/kogmbh/WebODF/pull/893))
8+
9+
110
# Changes between 0.5.6 and 0.5.7
211

312
## WebODF

programs/editor/Tools.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ define("webodf/editor/Tools", [
105105
sessionSubscribers.forEach(function (subscriber) {
106106
subscriber.setEditorSession(editorSession);
107107
});
108-
if (formatMenuButton) {
109-
formatMenuButton.setAttribute('disabled', !editorSession);
110-
}
108+
109+
[saveButton, saveAsButton, downloadButton, closeButton, formatMenuButton].forEach(function (button) {
110+
if (button) {
111+
button.setAttribute('disabled', !editorSession);
112+
}
113+
});
111114
}
112115

113116
this.setEditorSession = setEditorSession;
@@ -171,6 +174,7 @@ define("webodf/editor/Tools", [
171174
saveButton = new Button({
172175
label: tr('Save'),
173176
showLabel: false,
177+
disabled: true,
174178
iconClass: 'dijitEditorIcon dijitEditorIconSave',
175179
onClick: function () {
176180
saveOdtFile();
@@ -185,6 +189,7 @@ define("webodf/editor/Tools", [
185189
saveAsButton = new Button({
186190
label: tr('Save as...'),
187191
showLabel: false,
192+
disabled: true,
188193
iconClass: 'webodfeditor-dijitSaveAsIcon',
189194
onClick: function () {
190195
saveAsOdtFile();
@@ -199,6 +204,7 @@ define("webodf/editor/Tools", [
199204
downloadButton = new Button({
200205
label: tr('Download'),
201206
showLabel: true,
207+
disabled: true,
202208
style: {
203209
float: 'right'
204210
},
@@ -267,6 +273,7 @@ define("webodf/editor/Tools", [
267273
closeButton = new Button({
268274
label: tr('Close'),
269275
showLabel: false,
276+
disabled: true,
270277
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
271278
style: {
272279
float: 'right'

0 commit comments

Comments
 (0)