2017-10-03 14:24:00 -05:00
|
|
|
// @flow
|
|
|
|
|
|
2017-04-01 00:52:40 -05:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
|
2018-03-06 16:28:19 -08:00
|
|
|
/**
|
|
|
|
|
* Helper for getting the height of the toolbox.
|
|
|
|
|
*
|
|
|
|
|
* @returns {number} The height of the toolbox.
|
|
|
|
|
*/
|
|
|
|
|
export function getToolboxHeight() {
|
|
|
|
|
const toolbox = document.getElementById('new-toolbox');
|
|
|
|
|
|
|
|
|
|
return (toolbox && toolbox.clientHeight) || 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-26 15:52:41 -05:00
|
|
|
/**
|
|
|
|
|
* Indicates if a toolbar button is enabled.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} name - The name of the setting section as defined in
|
|
|
|
|
* interface_config.js.
|
|
|
|
|
* @returns {boolean} - True to indicate that the given toolbar button
|
|
|
|
|
* is enabled, false - otherwise.
|
|
|
|
|
*/
|
2017-10-03 14:24:00 -05:00
|
|
|
export function isButtonEnabled(name: string) {
|
2018-04-10 13:51:37 -07:00
|
|
|
return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
|
2017-07-26 15:52:41 -05:00
|
|
|
}
|