Skip to content

Commit

Permalink
#1887 Add s-group data for atom or bond without selection (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
epam-nikolai-iakushchenko authored Jan 11, 2023
1 parent 248f71d commit 57ec567
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/ketcher-react/src/script/editor/tool/sgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ class SGroupTool {
}

// TODO: handle click on an existing group?
if (id !== null || (selection && selection.atoms))
if (id !== null || (selection && selection.atoms)) {
this.editor.selection(selection)
SGroupTool.sgroupDialog(this.editor, id, this.type)
}
}

cancel() {
Expand All @@ -461,11 +463,6 @@ class SGroupTool {
const type = sg ? sg.type : defaultType
const eventName = type === 'DAT' ? 'sdataEdit' : 'sgroupEdit'

if (!selection.atoms && !selection.bonds && !sg) {
console.info('There is no selection or sgroup')
return
}

let attrs
if (sg) {
attrs = sg.getAttrs()
Expand Down

0 comments on commit 57ec567

Please sign in to comment.