Custom Toolbar List Menu action

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Rishabh
Posts: 10
Joined: Mon Aug 23, 2021 4:26 pm

Custom Toolbar List Menu action

Post by Rishabh »

I have successfully added the custom toolbar action list on DITA toolbar. And now my custom toolbar list is showing in the DITA toolbar but in the drop-down menu there are no items is showing.


So Can you please tell me how can I add n items to my custom toolbar list menu? With the help of the Javascript Plugin

I am attaching the screenshot for the same.


Implemented Code:
goog.events.listen(editor, sync.api.Editor.EventTypes.ACTIONS_LOADED, function(e) {
var actionsConfig = e.actionsConfiguration;
var ditaToolbar = null;
if (actionsConfig.toolbars) {
for (var i = 0; i < actionsConfig.toolbars.length; i++) {
var toolbar = actionsConfig.toolbars;
console.log(toolbar);
if (toolbar.name === "DITA") {
ditaToolbar = toolbar;
}
}
}

if (ditaToolbar) {
ditaToolbar.children.push({
children: [
{id: "covh1", type: "action"},
{id: "covh2", type: "action"},
{id: "covh3", type: "action"},
{id: "covh4", type: "action"},
],
name: actionId,
type: "list"
});
}
});



Screenshot from 2021-08-27 13-00-38.png
Screenshot from 2021-08-27 13-00-38.png (179.15 KiB) Viewed 1104 times
And after adding the menu items into the drop-down list. How I get the user-selected item from the drop-down with the help of JS plugin
Screenshot from 2021-08-27 13-00-45.png
Screenshot from 2021-08-27 13-00-45.png (181.29 KiB) Viewed 1104 times
Gabriel Titerlea
Site Admin
Posts: 95
Joined: Thu Jun 09, 2016 2:01 pm

Re: Custom Toolbar List Menu action

Post by Gabriel Titerlea »

This is a duplicate post.
You can find the answer on the original question here: post63258.html#p63258
Locked