ref(ToolbarButton): Remove unnecessary check.
This commit is contained in:
parent
f18b42b286
commit
53f675fbe0
|
@ -10,10 +10,7 @@ import {
|
||||||
} from '../../../../modules/UI/util/Tooltip';
|
} from '../../../../modules/UI/util/Tooltip';
|
||||||
|
|
||||||
import AbstractToolbarButton from './AbstractToolbarButton';
|
import AbstractToolbarButton from './AbstractToolbarButton';
|
||||||
import {
|
import { getButtonAttributesByProps } from '../functions';
|
||||||
getButtonAttributesByProps,
|
|
||||||
isButtonEnabled
|
|
||||||
} from '../functions';
|
|
||||||
|
|
||||||
declare var APP: Object;
|
declare var APP: Object;
|
||||||
|
|
||||||
|
@ -211,30 +208,26 @@ class ToolbarButton extends AbstractToolbarButton {
|
||||||
*/
|
*/
|
||||||
_setShortcutAndTooltip(): void {
|
_setShortcutAndTooltip(): void {
|
||||||
const { button, tooltipPosition } = this.props;
|
const { button, tooltipPosition } = this.props;
|
||||||
const name = button.buttonName;
|
|
||||||
|
|
||||||
if (isButtonEnabled(name)) {
|
if (!button.unclickable) {
|
||||||
|
if (button.tooltipText) {
|
||||||
if (!button.unclickable) {
|
setTooltipText(this.button,
|
||||||
if (button.tooltipText) {
|
button.tooltipText,
|
||||||
setTooltipText(this.button,
|
tooltipPosition);
|
||||||
button.tooltipText,
|
} else {
|
||||||
tooltipPosition);
|
setTooltip(this.button,
|
||||||
} else {
|
button.tooltipKey,
|
||||||
setTooltip(this.button,
|
tooltipPosition);
|
||||||
button.tooltipKey,
|
|
||||||
tooltipPosition);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (button.shortcut && APP && APP.keyboardshortcut) {
|
if (button.shortcut && APP && APP.keyboardshortcut) {
|
||||||
APP.keyboardshortcut.registerShortcut(
|
APP.keyboardshortcut.registerShortcut(
|
||||||
button.shortcut,
|
button.shortcut,
|
||||||
button.shortcutAttr,
|
button.shortcutAttr,
|
||||||
button.shortcutFunc,
|
button.shortcutFunc,
|
||||||
button.shortcutDescription
|
button.shortcutDescription
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue