Skip to content
Snippets Groups Projects
Select Git revision
  • 6a182bae33f8b5399c899806d5f4c81c8645d469
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

simpleASEndpoint.js

Blame
  • WindowThumbnailSettings.js 3.28 KiB
    import React, { Component } from 'react';
    import FormControlLabel from '@material-ui/core/FormControlLabel';
    import ListSubheader from '@material-ui/core/ListSubheader';
    import MenuItem from '@material-ui/core/MenuItem';
    import ThumbnailsOffIcon from '@material-ui/icons/CropDinSharp';
    import PropTypes from 'prop-types';
    import ThumbnailNavigationBottomIcon from './icons/ThumbnailNavigationBottomIcon';
    import ThumbnailNavigationRightIcon from './icons/ThumbnailNavigationRightIcon';
    /**
     *
     */
    export class WindowThumbnailSettings extends Component {
      /**
       * constructor -
       */
      constructor(props) {
        super(props);
        this.handleChange = this.handleChange.bind(this);
      }
    
      /**
       * @private
       */
      handleChange(value) {
        const { windowId, setWindowThumbnailPosition } = this.props;
    
        setWindowThumbnailPosition(windowId, value);
      }
    
      /**
       * render
       *
       * @return {type}  description
       */
      render() {
        const {
          classes, handleClose, t, thumbnailNavigationPosition, direction,
        } = this.props;
    
        return (
          <>
            <ListSubheader role="presentation" disableSticky tabIndex="-1">{t('thumbnails')}</ListSubheader>
    
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('off'); handleClose(); }}>
              <FormControlLabel
                value="off"
                classes={{ label: thumbnailNavigationPosition === 'off' ? classes.selectedLabel : classes.label }}
                control={
                  <ThumbnailsOffIcon color={thumbnailNavigationPosition === 'off' ? 'secondary' : undefined} />
                }
                label={t('off')}
                labelPlacement="bottom"
              />
            </MenuItem>
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('far-bottom'); handleClose(); }}>
              <FormControlLabel
                value="far-bottom"
                classes={{ label: thumbnailNavigationPosition === 'far-bottom' ? classes.selectedLabel : classes.label }}
                control={
                  <ThumbnailNavigationBottomIcon color={thumbnailNavigationPosition === 'far-bottom' ? 'secondary' : undefined} />
                }
                label={t('bottom')}
                labelPlacement="bottom"
              />
            </MenuItem>
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('far-right'); handleClose(); }}>
              <FormControlLabel
                value="far-right"
                classes={{ label: thumbnailNavigationPosition === 'far-right' ? classes.selectedLabel : classes.label }}
                control={(
                  <ThumbnailNavigationRightIcon
                    color={thumbnailNavigationPosition === 'far-right' ? 'secondary' : undefined}
                    style={direction === 'rtl' ? { transform: 'rotate(180deg)' } : {}}
                  />
                )}
                label={t('right')}
                labelPlacement="bottom"
              />
            </MenuItem>
          </>
        );
      }
    }
    
    WindowThumbnailSettings.propTypes = {
      classes: PropTypes.objectOf(PropTypes.string).isRequired,
      direction: PropTypes.string.isRequired,
      handleClose: PropTypes.func,
      setWindowThumbnailPosition: PropTypes.func.isRequired,
      t: PropTypes.func,
      thumbnailNavigationPosition: PropTypes.string.isRequired,
      windowId: PropTypes.string.isRequired,
    };
    WindowThumbnailSettings.defaultProps = {
      handleClose: () => {},
      t: key => key,
    };