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

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