瀏覽代碼

ref(ToolbarButton): Remove unnecessary check.

j8
hristoterezov 8 年之前
父節點
當前提交
53f675fbe0
共有 1 個文件被更改,包括 19 次插入26 次删除
  1. 19
    26
      react/features/toolbox/components/ToolbarButton.web.js

+ 19
- 26
react/features/toolbox/components/ToolbarButton.web.js 查看文件

10
 } from '../../../../modules/UI/util/Tooltip';
10
 } from '../../../../modules/UI/util/Tooltip';
11
 
11
 
12
 import AbstractToolbarButton from './AbstractToolbarButton';
12
 import AbstractToolbarButton from './AbstractToolbarButton';
13
-import {
14
-    getButtonAttributesByProps,
15
-    isButtonEnabled
16
-} from '../functions';
13
+import { getButtonAttributesByProps } from '../functions';
17
 
14
 
18
 declare var APP: Object;
15
 declare var APP: Object;
19
 
16
 
211
      */
208
      */
212
     _setShortcutAndTooltip(): void {
209
     _setShortcutAndTooltip(): void {
213
         const { button, tooltipPosition } = this.props;
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
 

Loading…
取消
儲存