-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Dataport/feature/geolocation-tooltip
add tooltip to geolocation icon
- Loading branch information
Showing
10 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## unpublished | ||
|
||
- Feature: Add optional tooltip to user geolocation map icon. | ||
|
||
## 1.0.0 | ||
|
||
Initial release. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import i18next from 'i18next' | ||
|
||
const setInnerHtml = (tooltip: HTMLDivElement) => () => | ||
(tooltip.innerHTML = `<h2>${i18next.t( | ||
'plugins.geoLocation.markerText' | ||
)}</h2>`) | ||
|
||
const style = ` | ||
background: rgba(255, 255, 255, 0.8); | ||
padding: 0.2em 0.5em; | ||
border-radius: 4px; | ||
color: #16161d; | ||
box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.5); | ||
` | ||
|
||
export const getTooltip = () => { | ||
const tooltip = document.createElement('div') | ||
tooltip.style.cssText = style | ||
|
||
setInnerHtml(tooltip)() | ||
i18next.on('languageChanged', setInnerHtml(tooltip)) | ||
i18next.store.on('added', setInnerHtml(tooltip)) | ||
|
||
return tooltip | ||
} |
This file contains 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
This file contains 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