Skip to content
Snippets Groups Projects
Select Git revision
  • ec86f5de3411e163dcddd1f1adf18df96e573332
  • 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

babel.config.js

Blame
  • viewers.js 898 B
    import { setIn } from 'immutable';
    import ActionTypes from '../actions/action-types';
    
    /**
     * viewersReducer
     */
    export const viewersReducer = (state = {}, action) => {
      switch (action.type) {
        case ActionTypes.UPDATE_VIEWPORT:
          return {
            ...state,
            [action.windowId]: {
              ...action.payload,
            },
          };
        case ActionTypes.REMOVE_WINDOW:
          return Object.keys(state).reduce((object, key) => {
            if (key !== action.windowId) {
              object[key] = state[key]; // eslint-disable-line no-param-reassign
            }
            return object;
          }, {});
        case ActionTypes.SET_WINDOW_VIEW_TYPE:
          return setIn(state, [action.windowId], null);
        case ActionTypes.SET_CANVAS:
          return setIn(state, [action.windowId], null);
        case ActionTypes.IMPORT_MIRADOR_STATE:
          return action.state.viewers;
        default:
          return state;
      }
    };