Revert "Update comment tooltip if shortcuts are disabled"
This reverts commit bb5ce666dca8fe80c9fce97a9fb1ee268e15634a.
Reason for revert: selection-action-box should not depend on restApiService
Change-Id: I21851327f8648903b0a7fd6420f2948522b93527
diff --git a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
index ea7f6cd..ee52ab6 100644
--- a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
+++ b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
@@ -23,7 +23,6 @@
import {PolymerElement} from '@polymer/polymer/polymer-element';
import {htmlTemplate} from './gr-selection-action-box_html';
import {fireEvent} from '../../../utils/event-util';
-import {appContext} from '../../../services/app-context';
declare global {
interface HTMLElementTagNameMap {
@@ -57,11 +56,6 @@
@property({type: Boolean})
positionBelow = false;
- @property({type: Boolean})
- disableKeyboardShortcuts = false;
-
- private readonly restApiService = appContext.restApiService;
-
/** @override */
created() {
super.created();
@@ -70,18 +64,6 @@
this.addEventListener('mousedown', e => this._handleMouseDown(e));
}
- attached() {
- this.restApiService.getPreferences().then(prefs => {
- if (prefs?.disable_keyboard_shortcuts) {
- this.disableKeyboardShortcuts = true;
- }
- });
- }
-
- _getTextForTooltip(disableKeyboardShortcuts: boolean) {
- return disableKeyboardShortcuts ? 'Click to comment' : 'Press c to comment';
- }
-
placeAbove(el: Text | Element | Range) {
flush();
const rect = this._getTargetBoundingRect(el);
diff --git a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box_html.ts b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box_html.ts
index d293967..24d63b3 100644
--- a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box_html.ts
+++ b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box_html.ts
@@ -27,7 +27,7 @@
</style>
<gr-tooltip
id="tooltip"
- text="[[_getTextForTooltip(disableKeyboardShortcuts)]]"
+ text="Press c to comment"
position-below="[[positionBelow]]"
></gr-tooltip>
`;