-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
91 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import action from 'actions'; | ||
|
||
/** | ||
* Adds a custom overlay to annotations on mouseHover, overriding the existing overlay. | ||
* @method WebViewerInstance#setAnnotationContentOverlayHandler | ||
* @param {function} customOverlayHandler a function that takes an annotation and returns a DOM Element, which is rendered as a tooltip when hovering over the annotation | ||
* * @example | ||
WebViewer(...) | ||
.then(function(instance) { | ||
instance.setAnnotationContentOverlayHandler(annotation => { | ||
const div = document.createElement('div'); | ||
div.appendChild(document.createTextNode(`Created by: ${annotation.Author}`)); | ||
div.appendChild(document.createElement('br')); | ||
div.appendChild(document.createTextNode(`Created on ${annotation.DateCreated}`)); | ||
return div; | ||
}); | ||
}); | ||
*/ | ||
|
||
export default store => annotationContentOverlayHandler => { | ||
store.dispatch(action.setAnnotationContentOverlayHandler(annotationContentOverlayHandler)); | ||
}; |
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