Skip to content
Snippets Groups Projects
Commit f56bc480 authored by Anthony's avatar Anthony
Browse files

WIP opening side to side. Adding Resource ok

parent bd89de46
No related branches found
No related tags found
2 merge requests!13Manifest side to side,!11Draft: 33 8 open an other manifest side by side from an annotation
......@@ -9,6 +9,8 @@ import Typography from '@material-ui/core/Typography';
import SanitizedHtml from '../containers/SanitizedHtml';
import { ScrollTo } from './ScrollTo';
/**
* CanvasAnnotations ~
*/
......@@ -22,6 +24,7 @@ export class CanvasAnnotations extends Component {
this.handleClick = this.handleClick.bind(this);
this.handleAnnotationHover = this.handleAnnotationHover.bind(this);
this.handleAnnotationBlur = this.handleAnnotationBlur.bind(this);
this.handleOpenManifestSideToSide = this.handleOpenManifestSideToSide.bind(this);
}
/**
......@@ -48,10 +51,17 @@ export class CanvasAnnotations extends Component {
/** */
handleAnnotationBlur() {
console.log('handleAnnotationBlur');
const { hoverAnnotation, windowId } = this.props;
hoverAnnotation(windowId, []);
}
handleOpenManifestSideToSide(annotation) {
console.log("open");
let manifestId = 'https://preview.iiif.io/cookbook/master/recipe/0003-mvm-video/manifest.json' // For testing purposes
const { addResource } = this.props;
addResource(manifestId);
}
/**
* Returns the rendered component
......@@ -108,6 +118,11 @@ export class CanvasAnnotations extends Component {
))
}
</div>
<div>
{annotation.format != 'application/json' && (
<button onClick={e => this.handleOpenManifestSideToSide(e, annotation)}>Ouvrir le manifest</button>
)}
</div>
</ListItemText>
</MenuItem>
</ScrollTo>
......@@ -120,6 +135,7 @@ export class CanvasAnnotations extends Component {
}
CanvasAnnotations.propTypes = {
addResource: PropTypes.func.isRequired,
annotations: PropTypes.arrayOf(
PropTypes.shape({
content: PropTypes.string.isRequired,
......
......@@ -46,6 +46,8 @@ const mapStateToProps = (state, { canvasId, windowId }) => ({
* @private
*/
const mapDispatchToProps = {
addResource: actions.addResource,
addWindow: actions.addWindow,
deselectAnnotation: actions.deselectAnnotation,
hoverAnnotation: actions.hoverAnnotation,
selectAnnotation: actions.selectAnnotation,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment