XFA
Well-known member
Hi,
I am trying to extend the editor in order to get some buttons state change when clicked as well as fonts dropdown or color editor.
I also want to change potentially their state upon editor load.
For color and font related dropdowns, I was able to get the state upon click through the commands.after event:
However, the other buttons such as bold or italic doesn't provide a state.
I could know their state by managing a state keeper all along since initialization of course but that's not necessarly convenient.
So four questions:
To set the buttons initial state, I tried doing that :
But it didn't work.
Hope you can help,
Thanks
Clément
I am trying to extend the editor in order to get some buttons state change when clicked as well as fonts dropdown or color editor.
I also want to change potentially their state upon editor load.
For color and font related dropdowns, I was able to get the state upon click through the commands.after event:
Code:
ed.events.on('commands.after', function(cmd, param1, param2)
{
console.log(cmd);
console.log(param1);
});
However, the other buttons such as bold or italic doesn't provide a state.
I could know their state by managing a state keeper all along since initialization of course but that's not necessarly convenient.
So four questions:
- Is there a way to get buttons state in the editor ?
- Is there a way to set the state of a button in the editor upon editor initialization ?
- Is there a way to select a default color in the editor upon editor initialization ?
- Is there a way to select an item from a dropdown (basically font size/family) in the editor upon editor initialization ?
To set the buttons initial state, I tried doing that :
Code:
ed.$tb.find('.fr-command.fr-btn[data-cmd=bold]')[0].click();
Hope you can help,
Thanks
Clément