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 714B

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