mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Merge pull request #893 from kossebau/disableCustomButtonsWithoutSession
Disable custom buttons save/saveAs/close/download when there is no session
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user