|
@@ -10,10 +10,7 @@ import {
|
10
|
10
|
} from '../../../../modules/UI/util/Tooltip';
|
11
|
11
|
|
12
|
12
|
import AbstractToolbarButton from './AbstractToolbarButton';
|
13
|
|
-import {
|
14
|
|
- getButtonAttributesByProps,
|
15
|
|
- isButtonEnabled
|
16
|
|
-} from '../functions';
|
|
13
|
+import { getButtonAttributesByProps } from '../functions';
|
17
|
14
|
|
18
|
15
|
declare var APP: Object;
|
19
|
16
|
|
|
@@ -211,31 +208,27 @@ class ToolbarButton extends AbstractToolbarButton {
|
211
|
208
|
*/
|
212
|
209
|
_setShortcutAndTooltip(): void {
|
213
|
210
|
const { button, tooltipPosition } = this.props;
|
214
|
|
- const name = button.buttonName;
|
215
|
|
-
|
216
|
|
- if (isButtonEnabled(name)) {
|
217
|
|
-
|
218
|
|
- if (!button.unclickable) {
|
219
|
|
- if (button.tooltipText) {
|
220
|
|
- setTooltipText(this.button,
|
221
|
|
- button.tooltipText,
|
222
|
|
- tooltipPosition);
|
223
|
|
- } else {
|
224
|
|
- setTooltip(this.button,
|
225
|
|
- button.tooltipKey,
|
226
|
|
- tooltipPosition);
|
227
|
|
- }
|
228
|
|
- }
|
229
|
211
|
|
230
|
|
- if (button.shortcut && APP && APP.keyboardshortcut) {
|
231
|
|
- APP.keyboardshortcut.registerShortcut(
|
232
|
|
- button.shortcut,
|
233
|
|
- button.shortcutAttr,
|
234
|
|
- button.shortcutFunc,
|
235
|
|
- button.shortcutDescription
|
236
|
|
- );
|
|
212
|
+ if (!button.unclickable) {
|
|
213
|
+ if (button.tooltipText) {
|
|
214
|
+ setTooltipText(this.button,
|
|
215
|
+ button.tooltipText,
|
|
216
|
+ tooltipPosition);
|
|
217
|
+ } else {
|
|
218
|
+ setTooltip(this.button,
|
|
219
|
+ button.tooltipKey,
|
|
220
|
+ tooltipPosition);
|
237
|
221
|
}
|
238
|
222
|
}
|
|
223
|
+
|
|
224
|
+ if (button.shortcut && APP && APP.keyboardshortcut) {
|
|
225
|
+ APP.keyboardshortcut.registerShortcut(
|
|
226
|
+ button.shortcut,
|
|
227
|
+ button.shortcutAttr,
|
|
228
|
+ button.shortcutFunc,
|
|
229
|
+ button.shortcutDescription
|
|
230
|
+ );
|
|
231
|
+ }
|
239
|
232
|
}
|
240
|
233
|
}
|
241
|
234
|
|