@primer/view-components 0.21.1 → 0.22.0-rc.afbfbb56
Sign up to get free protection for your applications and to get access to all the features.
@@ -34,18 +34,21 @@ export class ActionListTruncationObserver {
|
|
34
34
|
this.resizeObserver.unobserve(el);
|
35
35
|
}
|
36
36
|
update(el) {
|
37
|
-
const
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
37
|
+
const items = el.querySelectorAll('li');
|
38
|
+
for (const item of items) {
|
39
|
+
const label = item.querySelector('.ActionListItem-label');
|
40
|
+
if (!label)
|
41
|
+
continue;
|
42
|
+
const tooltip = item.querySelector('.ActionListItem-truncationTooltip');
|
43
|
+
if (!tooltip)
|
44
|
+
continue;
|
45
|
+
const isTruncated = label.scrollWidth > label.clientWidth;
|
46
|
+
if (isTruncated) {
|
47
|
+
tooltip.style.display = '';
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
tooltip.style.display = 'none';
|
51
|
+
}
|
49
52
|
}
|
50
53
|
}
|
51
54
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.22.0-rc.afbfbb56",
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
6
6
|
"module": "app/components/primer/primer.js",
|