diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-08 11:24:10 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-08 15:22:24 +0200 |
commit | 0197763d6f02ddb39b0f017b174582905ca75390 (patch) | |
tree | de5a96c3201188711cdb237e4b0ef27a73059aac | |
parent | notebookbar: custom shortcuts for impress (diff) | |
download | online-0197763d6f02ddb39b0f017b174582905ca75390.tar.gz online-0197763d6f02ddb39b0f017b174582905ca75390.zip |
notebookbar: use proper save action
Change-Id: I83f777f2d47c554365a8aa0305be9b5ef0cb4650
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93709
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | loleaflet/src/control/Control.NotebookbarBuilder.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 4a91b8e56c..809af3c352 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -41,6 +41,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:ConditionalFormatMenu'] = this._conditionalFormatControl; this._toolitemHandlers['.uno:SetDefault'] = this._clearFormattingControl; this._toolitemHandlers['.uno:Presentation'] = this._startPresentationControl; + this._toolitemHandlers['.uno:Save'] = this._saveControl; this._toolitemHandlers['.uno:SelectWidth'] = function() {}; this._toolitemHandlers['.uno:SetOutline'] = function() {}; @@ -389,6 +390,21 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ }); }, + _saveControl: function(parentContainer, data, builder) { + var control = builder._unoToolButton(parentContainer, data, builder); + + $(control.container).unbind('click'); + $(control.container).click(function () { + // Save only when not read-only. + if (builder.map._permission !== 'readonly') { + builder.map.fire('postMessage', {msgId: 'UI_Save'}); + if (!builder.map._disableDefaultAction['UI_Save']) { + builder.map.save(false, false); + } + } + }); + }, + build: function(parent, data, hasVerticalParent, parentHasManyChildren) { this._amendJSDialogData(data); |