Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Adds @pxgamer's changes and closes #7. New todos for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
hill committed Mar 27, 2018
1 parent 9856685 commit 9847837
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 13 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function createTooltip (content, isMarked = false) {
}
}

// removes the tooltip, arrow and content
function removeTooltip () {
if (tooltip != null) {
tooltip.parentNode.removeChild(tooltip)
Expand All @@ -97,7 +98,17 @@ function removeTooltip () {
}
}

window.onmousedown = removeTooltip
// Ensures the tldr tooltip does not close if clicked on
window.onmousedown = (mouseDownEvent) => {
let isPopup = false
mouseDownEvent.path.forEach((elementInPath) => {
if (elementInPath.id === 'tldr-chrome') isPopup = true
})

if (!isPopup) {
removeTooltip()
}
}

let commandList = []

Expand Down Expand Up @@ -136,6 +147,7 @@ function checkCode () {
})
}

// Deletes the tooltip and resizes when window is resized.
window.onresize = event => {
let oldContent
if (tooltip) {
Expand Down
10 changes: 5 additions & 5 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@
- [x] Better fonts
- [x] Remove styles inherited from document (thanks @pxgamer)

## v0.3.0
## ~~v0.3.0~~

- [ ] comment / document current codebase
- [ ] flip tooltip position based on where the element is on the page
- [x] comment / document current codebase
- [x] Convert to `fetch` rather than `XMLHttpRequest` (see #4)
- [ ] Ensure the tooltip does not disappear when clicking within the tooltip itself but is removed when user clicks outside of the tooltip
- [x] Ensure the tooltip does not disappear when clicking within the tooltip itself but is removed when user clicks outside of the tooltip

## v1.0.0 :raised_hands: (release)
- [x] Icon for right-click menu bar
- [x] Icon for store
- [ ] Screenshots
- [ ] Description
- [ ] Better README
- [ ] Contribution Guidelines

## Other features
- [ ] search for keywords in pre and code tags
Expand All @@ -38,5 +36,7 @@
- [ ] keyboard shortcut
- [ ] light theme
- [ ] compose button
- [ ] flip tooltip position based on where the element is on the page
- [ ] copy to clipboard

(To request a feature you can create an issue *or*, better yet, submit a pull request with the feature implemented :wink:)

0 comments on commit 9847837

Please sign in to comment.