Skip to content
Snippets Groups Projects
Commit 393b6a9f authored by Ashod Nakashian's avatar Ashod Nakashian Committed by Jan Holesovsky
Browse files

leaflet: show/hide commands demo

This demonstrates the use of show and hide
functionality via Show/Hide_Button and
Show/Hide_Menu_Item postMessage events.

Save and Print buttons and menu items are
controlled in the demo.

Change-Id: I81dfea816765da50a1c20699b460765ae35f60a6
Reviewed-on: https://gerrit.libreoffice.org/74130


Reviewed-by: default avatarAndras Timar <andras.timar@collabora.com>
Tested-by: default avatarAndras Timar <andras.timar@collabora.com>
(cherry picked from commit 89ae4278)
Reviewed-on: https://gerrit.libreoffice.org/82704


Tested-by: default avatarJenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: default avatarJan Holesovsky <kendy@collabora.com>
parent 7fdb0cf9
No related tags found
No related merge requests found
......@@ -46,6 +46,30 @@
'*');
}
function save() {
post({'MessageId': 'Action_Save',
'Values': { 'Notify': true, }
});
}
function hide_commands(id) {
post({'MessageId': 'Hide_Menu_Item',
'Values': { 'id': id, }
});
post({'MessageId': 'Hide_Button',
'Values': { 'id': id, }
});
}
function show_commands(id) {
post({'MessageId': 'Show_Menu_Item',
'Values': { 'id': id, }
});
post({'MessageId': 'Show_Button',
'Values': { 'id': id, }
});
}
// This function is invoked when the iframe posts a message back.
function receiveMessage(event) {
......@@ -72,7 +96,12 @@
</form>
<form id="insert-text-form">
Click <button onclick="capitalize(); return false;">here</button> to capitalize selected text in the document:
Click <button onclick="capitalize(); return false;">here</button> to capitalize selected text in the document.</br></br>
<button onclick="save(); return false;">Save</button></br></br>
<button onclick="hide_commands('save'); return false;">Hide Save Commands</button>
<button onclick="show_commands('save'); return false;">Show Save Commands</button></br>
<button onclick="hide_commands('print'); return false;">Hide Print Commands</button>
<button onclick="show_commands('print'); return false;">Show Print Commands</button></br></br>
</form>
<!-- The hostname and pathnames below are obviously specific to my
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment