UNPKG

@eclipse-scout/core

Version:
33 lines (28 loc) 1.02 kB
/* * Copyright (c) 2010, 2024 BSI Business Systems Integration AG * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 */ import {Action, ActionKeyStroke} from '../../index'; export class TableControlActionKeyStroke extends ActionKeyStroke { constructor(action: Action) { super(action); this.renderingHints.offset = 6; } override handle(event: JQuery.KeyboardEventBase) { this.field.toggle(); } protected override _postRenderKeyBox($drawingArea: JQuery, $keyBox?: JQuery) { if (this.field.iconId) { let wIcon = $drawingArea.find('.icon').width(); let wKeyBox = $drawingArea.find('.key-box').outerWidth(); let containerPadding = $drawingArea.cssPaddingLeft(); let leftKeyBox = wIcon / 2 - wKeyBox / 2 + containerPadding; $drawingArea.find('.key-box').cssLeft(leftKeyBox); } } }