Merge pull request #893 from kossebau/disableCustomButtonsWithoutSession

Disable custom buttons save/saveAs/close/download when there is no session
This commit is contained in:
Friedrich
2015-05-20 16:24:51 +02:00
2 changed files with 19 additions and 3 deletions
+9
View File
@@ -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
+10 -3
View File
@@ -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;
@@ -171,6 +174,7 @@ define("webodf/editor/Tools", [
saveButton = new Button({
label: tr('Save'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconSave',
onClick: function () {
saveOdtFile();
@@ -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();
@@ -199,6 +204,7 @@ define("webodf/editor/Tools", [
downloadButton = new Button({
label: tr('Download'),
showLabel: true,
disabled: true,
style: {
float: 'right'
},
@@ -267,6 +273,7 @@ define("webodf/editor/Tools", [
closeButton = new Button({
label: tr('Close'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
style: {
float: 'right'