Skip to content

Commit

Permalink
postmessage: added message to collapse / extend notebookbar
Browse files Browse the repository at this point in the history
The new messages are: Collapse_Notebookbar and Extend_Notebookbar
As a side effect they also hide the classic toolbar the same way

Signed-off-by: Hubert Figuière <[email protected]>
Change-Id: Ic9d04876acb06f2885a6be1e171df7f87e513ed8
  • Loading branch information
hfiguiere committed Oct 30, 2023
1 parent 5b14c12 commit 60897d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions browser/html/framed.doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
'Values': {'Mode': value}});
}

function CollapseNotebookbar(collapse) {
post({'MessageId': collapse ? 'Collapse_Notebookbar' : 'Extend_Notebookbar',
'Values': null
});
}

function Execute(messageId, values) {
post({'MessageId': messageId, 'Values': values});
}
Expand Down Expand Up @@ -361,6 +367,8 @@ <h3>UI modification</h3>
<p>
<button onclick="ShowNotebookbar(false); return false;">Compact Toolbar</button>
<button onclick="ShowNotebookbar(true); return false;">Tabbed Toolbar</button>
<button onclick="CollapseNotebookbar(true); return false;">Collapse Tabbed Toolbar</button>
<button onclick="CollapseNotebookbar(false); return false;">Extend Tabbed Toolbar</button>
</form>

<h3>Send UNO Commands</h3>
Expand Down
8 changes: 8 additions & 0 deletions browser/src/map/handler/Map.WOPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@ L.Map.WOPI = L.Handler.extend({
this._map.uiManager.hideRuler();
return;
}
else if (msg.MessageId === 'Collapse_Notebookbar') {
this._map.uiManager.collapseNotebookbar();
return;
}
else if (msg.MessageId === 'Extend_Notebookbar') {
this._map.uiManager.extendNotebookbar();
return;
}
else if (msg.MessageId === 'Show_Menu_Item' || msg.MessageId === 'Hide_Menu_Item') {
if (!msg.Values) {
window.app.console.error('Property "Values" not set');
Expand Down

0 comments on commit 60897d6

Please sign in to comment.