Skip to content

Commit b576bd6

Browse files
committed
[PRAC/cont] Add tooltips for cells
Initializing Tippy for header tbl cells. Worth noting: - attempts to realize different variants of tooltips placement, depending on the change of the screen width. core: B-3 / JS-BL
1 parent 2a90e89 commit b576bd6

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-client/css/crm-output.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080

8181
.crm__output-table #table-th-contact {
8282
width: 145px;
83+
cursor: default;
84+
}
85+
86+
.crm__output-table #table-th-action {
87+
cursor: default;
8388
}
8489

8590
.crm__o-table-head-cell:focus-visible {

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-client/css/custom-tippy.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212

1313
.tippy-box[data-theme~="main"] .tippy-arrow {
1414
margin-top: -1px;
15+
margin-right: -1px;
1516
color: var(--main-purple);
1617
}

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-client/js/customTippy.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
// инициализация Tippy только/для #search-logo (в зависимости от ширины экрана)
2929
function initTippyForSearchLogo() {
30-
const isSmallWidth = window.matchMedia('(max-width: 320px)').matches;
30+
const isSmallWidth = window.matchMedia('(max-width: 320px)').matches; // уточнение ширины
3131
const searchLogo = document.querySelector('#search-logo');
3232

3333
if (isSmallWidth && searchLogo && !searchLogo._tippy) {
@@ -41,7 +41,21 @@
4141

4242
// инициализация Tippy для/всех "остальных" элементов (без учёта ширины экрана)
4343
function initTippyForOther() {
44-
// initTippy('#another-element', 'Подсказка для другого элемента', 'right');
44+
initTippy('#hash-tag-title', 'сбросить сортировку', 'bottom', {
45+
offset: [0, 2],
46+
});
47+
initTippy('#table-th-id', 'сортировать ⇵', 'bottom', {
48+
offset: [0, 2],
49+
});
50+
initTippy('#table-th-fio', 'сортировать ⇵', 'bottom', {
51+
offset: [0, 2],
52+
});
53+
initTippy('#table-th-dt', 'сортировать ⇵', 'bottom', {
54+
offset: [0, 2],
55+
});
56+
initTippy('#table-th-change', 'сортировать ⇵', 'bottom', {
57+
offset: [0, 2],
58+
});
4559
}
4660

4761
initTippyForSearchLogo();

0 commit comments

Comments
 (0)