File tree Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Expand file tree Collapse file tree 3 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -1213,6 +1213,11 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
1213
1213
for ( const menu of this . menus_ ) {
1214
1214
menu . classList . add ( 'shaka-low-position' ) ;
1215
1215
}
1216
+ // Tooltips need to be positioned lower if the seekbar is absent.
1217
+ const controlsButtonPanel = this . controlsButtonPanel_ ;
1218
+ if ( controlsButtonPanel . classList . contains ( 'shaka-tooltips-on' ) ) {
1219
+ controlsButtonPanel . classList . add ( 'shaka-tooltips-low-position' ) ;
1220
+ }
1216
1221
}
1217
1222
}
1218
1223
@@ -1941,10 +1946,18 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
1941
1946
for ( const menu of this . menus_ ) {
1942
1947
menu . classList . remove ( 'shaka-low-position' ) ;
1943
1948
}
1949
+ const controlsButtonPanel = this . controlsButtonPanel_ ;
1950
+ if ( controlsButtonPanel . classList . contains ( 'shaka-tooltips-on' ) ) {
1951
+ controlsButtonPanel . classList . remove ( 'shaka-tooltips-low-position' ) ;
1952
+ }
1944
1953
} else {
1945
1954
for ( const menu of this . menus_ ) {
1946
1955
menu . classList . add ( 'shaka-low-position' ) ;
1947
1956
}
1957
+ const controlsButtonPanel = this . controlsButtonPanel_ ;
1958
+ if ( controlsButtonPanel . classList . contains ( 'shaka-tooltips-on' ) ) {
1959
+ controlsButtonPanel . classList . add ( 'shaka-tooltips-low-position' ) ;
1960
+ }
1948
1961
}
1949
1962
}
1950
1963
Original file line number Diff line number Diff line change 86
86
}
87
87
}
88
88
89
- /* If the seekbar is missing, this is positioned lower.
90
- * TODO: Solve with flex layout instead? */
89
+ // If the seekbar is missing, this is positioned lower.
91
90
& .shaka-low-position {
92
- /* TODO(b/116651454): eliminate hard-coded offsets */
93
- bottom : 15px ;
91
+ bottom : @material-icons-width ;
94
92
}
95
93
}
96
94
Original file line number Diff line number Diff line change 39
39
.shaka-tooltips-on {
40
40
overflow : visible ;
41
41
42
- & > [class *= " shaka-tooltip" ] {
42
+ & > . shaka-tooltip {
43
43
position : relative ;
44
44
45
45
/* The :after pseudo-element contains the tooltip */
46
- & :hover :after , & :focus-visible :after , & :active :after {
46
+ & :hover :after ,
47
+ & :focus-visible :after ,
48
+ & :active :after {
47
49
content : attr (aria-label );
48
50
49
51
/* Override .material-icons-round text styling */
70
72
}
71
73
}
72
74
75
+ // If the seekbar is missing, this is positioned lower.
76
+ & .shaka-tooltips-low-position {
77
+ & > .shaka-tooltip {
78
+ & :hover :after ,
79
+ & :focus-visible :after ,
80
+ & :active :after {
81
+ bottom : @material-icons-width ;
82
+ }
83
+ }
84
+ }
85
+
73
86
/* Adds an additional attribute for the status in .shaka-tooltip-status */
74
87
& > .shaka-tooltip-status {
75
88
& :hover :after , & :focus-visible :after , & :active :after {
You can’t perform that action at this time.
0 commit comments