-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1824: expand function groups on hover #1907
Conversation
@@ -229,13 +229,12 @@ Render.prototype.update = function (force = false, viewSz = null) { | |||
const marg = this.options.autoScaleMargin | |||
const mv = new Vec2(marg, marg) | |||
const csz = viewSz | |||
if (csz.x < 2 * marg + 1 || csz.y < 2 * marg + 1) { | |||
if (marg && (csz.x < 2 * marg + 1 || csz.y < 2 * marg + 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to name it autoScaleMargin
@@ -52,6 +52,12 @@ export class FunctionalGroup { | |||
) | |||
} | |||
|
|||
static getFunctionalGroupByName(searchName: string): Struct | null { | |||
const provider = FunctionalGroupsProvider.getInstance() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future: I think, may be its worth to make methods static. It's unlikely that we will have multiple functional groups types.
static getFunctionalGroupByName(searchName: string): Struct | null { | ||
const provider = FunctionalGroupsProvider.getInstance() | ||
const types = provider.getFunctionalGroupsList() | ||
return types.find((fnGroup) => fnGroup.name === searchName) || null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to rename it to functionalGroups
if (!isAtomToolChosen) { | ||
this.hoverIcon.hide() | ||
// hide icon if not AtomToll chosen | ||
if (name !== 'atom') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess, there was some mistake during merge. Previous solution was better :)
@@ -155,7 +156,10 @@ export default function initEditor(dispatch, getState) { | |||
}, | |||
onSgroupEdit: (sgroup) => | |||
sleep(0) // huck to open dialog after dispatch sgroup tool action | |||
.then(() => openDialog(dispatch, 'sgroup', fromSgroup(sgroup))) | |||
.then(() => { | |||
console.log('onSgroupEdit') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to remove this console.log
} | ||
|
||
// @ts-ignore | ||
var groupStructPosition = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to use const
let rX = 0 | ||
let rY = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is r
mean in rX
and rY
?
? functionGroupInfoSelector(store).groupId | ||
: null, | ||
functionalGroups: allSGroupsSelector(store).map((template) => { | ||
const struct = template.struct.clone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for modifiedStruct
anymore
) | ||
} | ||
export default connect((store) => ({ | ||
groupName: functionGroupInfoSelector(store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be functionGroupInfoSelector(store)?.id || null
and the same for others?
packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx
Outdated
Show resolved
Hide resolved
Merging for release candidate, a fix is coming shortly |
No description provided.