Skip to content
Snippets Groups Projects
Select Git revision
  • ab9e6df39f36f4097eac2672ea02d8078289875c
  • mui5-tetras-main-stable default protected
  • mui5-tetras-main-old-stable
  • preprod protected
  • 75-dernieres-ameliorations-avant-workshop-du-7-02
  • wip-fix-xywh
  • wip-positionement-annot
  • wip-surface-transformer
  • uploads-file
  • 69-la-video-demare-quand-on-fait-glisser-le-slider-et-le-clic-creer-un-decalage-entre-le-player
  • 61-recettage-des-outils-d-annotation
  • gestion_multiple_ouverture_pannel_annotation
  • autorisation_un_pannel_annotation
  • autorisation_un_pannel_edition_annotation
  • récupération_temps_video
  • save-shapes-and-position
  • fix-error-create-annotation-pannel
  • time-saving-on-annotation
  • tetras-main protected
  • fix-poc-mirador
  • tetras-antho-test
21 results

miradorAnnotationPlugin.test.js

Blame
  • WindowTopMenuButton.js 1.84 KiB
    import React, { Component } from 'react';
    import { compose } from 'redux';
    import IconButton from '@material-ui/core/IconButton';
    import MoreVertIcon from '@material-ui/icons/MoreVert';
    import { withStyles } from '@material-ui/core/styles';
    import PropTypes from 'prop-types';
    import WindowTopMenu from '../containers/WindowTopMenu';
    
    /**
     */
    class WindowTopMenuButton extends Component {
      /**
       * constructor -
       */
      constructor(props) {
        super(props);
        this.state = {
          anchorEl: null,
        };
        this.handleMenuClick = this.handleMenuClick.bind(this);
        this.handleMenuClose = this.handleMenuClose.bind(this);
      }
    
      /**
       * @private
       */
      handleMenuClick(event) {
        this.setState({
          anchorEl: event.currentTarget,
        });
      }
    
      /**
       * @private
       */
      handleMenuClose() {
        this.setState({
          anchorEl: null,
        });
      }
    
      /**
       * render
       * @return
       */
      render() {
        const { classes, windowId } = this.props;
        const { anchorEl } = this.state;
    
        return (
          <>
            <IconButton
              color="inherit"
              aria-label="Menu"
              className={classes.ctrlBtn}
              aria-haspopup="true"
              onClick={this.handleMenuClick}
              aria-owns={anchorEl ? `window-menu_${windowId}` : undefined}
            >
              <MoreVertIcon />
            </IconButton>
            <WindowTopMenu
              windowId={windowId}
              anchorEl={anchorEl}
              handleClose={this.handleMenuClose}
            />
          </>
        );
      }
    }