-
Notifications
You must be signed in to change notification settings - Fork 20
Vmo 4394 connection z index #184
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
Open
poojahpatil90
wants to merge
4
commits into
master
Choose a base branch
from
VMO-4394-connection-zIndex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5045b69
VMO-4394 Raise the z-index of wires on hover and click
poojahpatil90 2e90531
Merge branch 'master' into VMO-4394-connection-zIndex
poojahpatil90 f9026d0
VMO-4394 Using DOM handle derived from leader-line id
poojahpatil90 9b4de5d
VMO-4394 Fixing review comment
poojahpatil90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ export default { | |
| // no need to set up observers over this | ||
| // line: null, | ||
| isPermanentlyActive: false, | ||
| connectionDomHandle: HTMLElement, | ||
| } | ||
| }, | ||
|
|
||
|
|
@@ -140,18 +141,16 @@ export default { | |
|
|
||
| this.line = new LeaderLine(start, end, this.options) | ||
|
|
||
| // Add event listeners | ||
| const self = this | ||
| // the only way to identify current line so far: https://github.com/anseki/leader-line/issues/185 | ||
| const connectionElement = document.querySelector('body>.leader-line:last-of-type') | ||
| this.connectionDomHandle = document.getElementById(`leader-line-${this.line._id}-line-path`).closest('svg.leader-line') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reporter: ESLint Unexpected dangling '_' in '_id'. (no-underscore-dangle)
|
||
|
|
||
| connectionElement.addEventListener('click', self.clickHandler, false) | ||
| // Add event listeners | ||
| this.connectionDomHandle.addEventListener('click', this.clickHandler, false) | ||
|
|
||
| connectionElement.addEventListener('click', self.clickAwayHandler(connectionElement), false) | ||
| this.clickAwayHandler(this.connectionDomHandle) | ||
|
|
||
| connectionElement.addEventListener('mouseover', self.mouseOverHandler, false) | ||
| this.connectionDomHandle.addEventListener('mouseover', this.mouseOverHandler, false) | ||
|
|
||
| connectionElement.addEventListener('mouseout', self.mouseOutHandler, false) | ||
| this.connectionDomHandle.addEventListener('mouseout', this.mouseOutHandler, false) | ||
|
|
||
| // stop listening to scroll and window resize hooks | ||
| // LeaderLine.positionByWindowResize = false | ||
|
|
@@ -182,19 +181,22 @@ export default { | |
| mouseOverHandler() { | ||
| this.line.setOptions(this.prominentOptions) | ||
| this.activateConnection({connectionContext: this.connectionContext}) | ||
| this.connectionDomHandle.style.zIndex = 1 | ||
| this.$emit('lineMouseIn') | ||
| }, | ||
| mouseOutHandler() { | ||
| if (!this.isPermanentlyActive) { | ||
| this.line.setOptions(this.options) | ||
| this.deactivateConnection({connectionContext: this.connectionContext}) | ||
| } | ||
| this.connectionDomHandle.style.zIndex = 0 | ||
| this.$emit('lineMouseOut') | ||
| }, | ||
| clickHandler() { | ||
| this.isPermanentlyActive = true | ||
| this.activateConnection({connectionContext: this.connectionContext}) | ||
| this.activateBlock({blockId: null}) | ||
| this.connectionDomHandle.style.zIndex = 1 | ||
poojahpatil90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| this.$emit('lineMouseIn') | ||
| }, | ||
| clickAwayHandler(connectionElement) { | ||
|
|
@@ -213,6 +215,7 @@ export default { | |
| this.line.setOptions(this.options) | ||
| this.deactivateConnection({connectionContext: this.connectionContext}) | ||
| } | ||
| this.connectionDomHandle.style.zIndex = 0 | ||
| this.$emit('lineMouseOut') | ||
| }, false) | ||
| }, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 remove the reference to self as it did not make any difference in the functionality. Let me know if there is concern around this change.