partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Creating custom buttons #265

Open kwen1510 opened 2 years ago

kwen1510 commented 2 years ago

Hi @partridgejiang, I would like to create custom buttons with common groups that I will use (e.g. -OH, -Cl), without using the atomAndFormula button. Is there a way to do so?

Also, when I try to use the atomAndFormula on my phone, it zooms in a lot and I cannot edit the molecule anymore. Do you know why that is the case?

Thank you!

partridgejiang commented 2 years ago

Hi @kuaaangwen, you may refer to the discussions in issue #209. The attached demo file may also be helpful. SpecificAtomIaController.zip

partridgejiang commented 2 years ago

By the way, to avoid the auto-zoom of the <input> element in phone, you may add the following code in the <head> part of the HTML page:

<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />