-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
menubarmenulistitemview.ts
46 lines (39 loc) · 1.3 KB
/
menubarmenulistitemview.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @module ui/menubar/menubarmenulistitemview
*/
import type { Locale } from '@ckeditor/ckeditor5-utils';
import ListItemView from '../list/listitemview.js';
import type MenuBarMenuView from './menubarmenuview.js';
import '../../theme/components/menubar/menubarmenulistitem.css';
/**
* A menu bar list item view, a child of {@link module:ui/menubar/menubarmenulistview~MenuBarMenuListView}.
*
* Populate this item with a {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} instance
* or a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance to create a sub-menu.
*/
export default class MenuBarMenuListItemView extends ListItemView {
/**
* Creates an instance of the list item view.
*
* @param locale The localization services instance.
*/
constructor( locale: Locale, parentMenuView: MenuBarMenuView ) {
super( locale );
const bind = this.bindTemplate;
this.extendTemplate( {
attributes: {
class: [
'ck-menu-bar__menu__item'
]
},
on: {
'mouseenter': bind.to( 'mouseenter' )
}
} );
this.delegate( 'mouseenter' ).to( parentMenuView );
}
}