feat(tooltips): added translatable tooltip

This commit is contained in:
Johannes Eder 2021-10-19 20:52:00 +02:00
parent 61c773f51c
commit e74b61065a
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,6 @@
export class FrontendTooltips {
static addToolTip(element, text) {
console.log('adding Tooltip');
let tooltipWrap = document.createElement('span');
tooltipWrap.className = 'tooltip';

View File

@ -1,6 +1,7 @@
import { Utility } from '../../core/utility';
import { TableIndices } from '../../lib/table/table';
import { FrontendTooltips } from '../../lib/tooltips/frontend-tooltips';
import { Translations } from '../../messages';
const CHECKRANGE_INITIALIZED_CLASS = 'checkrange--initialized';
@ -39,7 +40,9 @@ export class CheckRange {
_setUpShiftClickOnColumn(columnId) {
let column = this._columns[columnId];
FrontendTooltips.addToolTip(column[0], 'Shift Click to mark multiple cells');
let language = document.documentElement.lang;
let toolTipMessage = Translations.getTranslation('checkrangeTooltip', language);
FrontendTooltips.addToolTip(column[0], toolTipMessage);
column.forEach(el => el.addEventListener('click', (ev) => {
if(ev.shiftKey && this.lastCheckedCell !== null) {