Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit d490d61

Browse files
authored
Merge pull request #373 from ckeditor/t/ckeditor5-theme-lark/134
Other: Added a CSS class to the SplitButtonView when the arrow is on (see ckeditor/ckeditor5-theme-lark#134).
2 parents 34fad4d + 68587a4 commit d490d61

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/dropdown/button/splitbuttonview.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export default class SplitButtonView extends View {
109109
attributes: {
110110
class: [
111111
'ck-splitbutton',
112-
bind.if( 'isVisible', 'ck-hidden', value => !value )
112+
bind.if( 'isVisible', 'ck-hidden', value => !value ),
113+
this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
113114
]
114115
},
115116

tests/dropdown/button/splitbuttonview.js

+8
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ describe( 'SplitButtonView', () => {
5252
expect( view.actionView.element.classList.contains( 'ck-hidden' ) ).to.be.false;
5353
} );
5454

55+
it( 'binds arrowView#isOn to the template', () => {
56+
view.arrowView.isOn = true;
57+
expect( view.element.classList.contains( 'ck-splitbutton_open' ) ).to.be.true;
58+
59+
view.arrowView.isOn = false;
60+
expect( view.element.classList.contains( 'ck-splitbutton_open' ) ).to.be.false;
61+
} );
62+
5563
describe( 'activates keyboard navigation for the toolbar', () => {
5664
it( 'so "arrowright" on view#arrowView does nothing', () => {
5765
const keyEvtData = {

theme/components/dropdown/splitbutton.css

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* For licensing, see LICENSE.md.
44
*/
55

6+
@import "../tooltip/mixins/_tooltip.css";
7+
68
.ck-splitbutton {
79
/* Enable font size inheritance, which allows fluid UI scaling. */
810
font-size: inherit;
@@ -11,3 +13,8 @@
1113
z-index: calc(var(--ck-z-default) + 1);
1214
}
1315
}
16+
17+
/* Disable tooltips for the buttons when the button is "open" */
18+
.ck-splitbutton.ck-splitbutton_open > .ck-button {
19+
@mixin ck-tooltip_disabled;
20+
}

0 commit comments

Comments
 (0)