-
Notifications
You must be signed in to change notification settings - Fork 14
[OGUI-1851] ObjectInfo Panel on hover should be left/right depending on position #3246
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
base: dev
Are you sure you want to change the base?
Conversation
| const { name, id } = tabObject; | ||
| const { filterModel, router, object, services } = model; | ||
| const isSelectedOpen = object.selectedOpen; | ||
| const isSelectedOpen = object.selectedOpenName === id; |
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.
Doing this, it means that the selection will stay open only for one object which is not what we desired.
The functionality was requested and implemented in such a way that the users can quickly hover over the objects in sequence with the pop-up staying open so that they can compare the metadata.
| { | ||
| style: 'right:0.1em; width: 35em;left: auto;', | ||
| onupdate: (vnode) => { | ||
| if (object.isOnLeftSide(vnode.dom.parentElement)) { | ||
| vnode.dom.style.left = '0.1em'; | ||
| vnode.dom.style.right = 'auto'; | ||
| } else { | ||
| vnode.dom.style.right = '0.1em'; | ||
| vnode.dom.style.left = 'auto'; | ||
| } | ||
| }, | ||
| }, |
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.
Would it not be better to calculate the style position above and use it here directly rather than setting a position on L50, just to modify after?
| * @returns {boolean|undefined} Returns true if the element is on the left half of the window, | ||
| * false if it is on the right half, or undefined if no element is provided. | ||
| */ | ||
| isOnLeftSide(element) { |
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.
I think this would be better in a util folder so that other components can use it if needed
I have JIRA issue created
When viewing a layout, the user has the option to hover over a plot and get multiple options. Here, they can click on the
infoicon to get a panel with information about the object.The problem lies of the fact that if the object is positioned on the left side of the screen, it will not be visible properly.
Now when we are on the left side of the window it will render the dropdown to the right of the button anchor.