Skip to content

Commit

Permalink
fix cannot delete single atom molecule [#73 state:committed]
Browse files Browse the repository at this point in the history
  • Loading branch information
novakps committed Sep 20, 2010
1 parent 5cb3be2 commit 57e7dbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kemia/controller/plugins/erase.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ kemia.controller.plugins.Erase.prototype.eraseAtom = function(atom) {
molecule.removeBond(bond);
});
molecule.removeAtom(atom);
if (molecule.atoms.length == 0) {
molecule.reaction.removeMolecule(molecule);
}
this.editorObject.setModels(this.editorObject.getModels());
};

Expand Down

0 comments on commit 57e7dbf

Please sign in to comment.