Open cleblond opened 3 years ago
Hi @cleblond, it's a long-forgotten property which can not work properly for a long time, :(. Thanks for revealing it and I have make some efforts to let it run again in the latest dist files. You can turn it on by:
composer.getIaController('MolBondIaController').setAutoSwitchBondOrder(true);
After that, the original single bond tool can be used on existing bond to switch between single/double/triple orders (similar to the behavior of ChemDraw).
I updated to latest dist but am getting the following error.
Cannot read property 'setAutoSwitchBondOrder' of undefined.
This is what I tried
var composer = Kekule.Widget.getWidgetById('composer');
composer.getIaController('MolBondIaController').setAutoSwitchBondOrder(true);
Sorry that I have made a mistake, :(, the code should be:
composer.getEditor().getIaController('MolBondIaController').setAutoSwitchBondOrder(true);
I was looking into making a controller that cycles bond order when I click on a bond. I came across autoSwitchBondOrder and was wondering how I set this to true.