您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

actions.native.js 646B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { TOGGLE_TOOLBOX_VISIBLE } from './actionTypes';
  4. export * from './actions.any';
  5. /**
  6. * Action to toggle the toolbox visibility.
  7. *
  8. * @returns {Function}
  9. */
  10. export function toggleToolboxVisible() {
  11. return (dispatch: Dispatch<any>, getState: Function) => {
  12. const state = getState();
  13. const { toolbarConfig: { alwaysVisible } } = state['features/base/config'];
  14. const { visible } = state['features/toolbox'];
  15. if (visible && alwaysVisible) {
  16. return;
  17. }
  18. dispatch({
  19. type: TOGGLE_TOOLBOX_VISIBLE
  20. });
  21. };
  22. }