You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.web.js 794B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. declare var interfaceConfig: Object;
  3. export {
  4. abstractMapDispatchToProps,
  5. abstractMapStateToProps,
  6. getButton
  7. } from './functions.native';
  8. /**
  9. * Helper for getting the height of the toolbox.
  10. *
  11. * @returns {number} The height of the toolbox.
  12. */
  13. export function getToolboxHeight() {
  14. const toolbox = document.getElementById('new-toolbox');
  15. return (toolbox && toolbox.clientHeight) || 0;
  16. }
  17. /**
  18. * Indicates if a toolbar button is enabled.
  19. *
  20. * @param {string} name - The name of the setting section as defined in
  21. * interface_config.js.
  22. * @returns {boolean} - True to indicate that the given toolbar button
  23. * is enabled, false - otherwise.
  24. */
  25. export function isButtonEnabled(name: string) {
  26. return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
  27. }