-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubmenu-icon.js
55 lines (55 loc) · 2.1 KB
/
submenu-icon.js
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
47
48
49
50
51
52
53
54
55
(function() {
tinymce.PluginManager.add('gk_tc_button2', function( editor, url ) {
editor.addButton( 'gk_tc_button2', {
title: 'My test button',
type: 'menubutton',
icon: 'icon gk-own-icon',
menu: [
{
text: 'Menu item I',
value: 'Text from menu item I',
icon: 'icon dashicons-wordpress',
onclick: function() {
editor.insertContent(this.value());
}
},
{
text: 'Menu item II',
value: 'Text from menu item II',
icon: 'icon dashicons-wordpress-alt',
onclick: function() {
editor.insertContent(this.value());
},
menu: [
{
text: 'First submenu item',
value: 'Text from sub sub menu',
icon: 'icon dashicons-smiley',
onclick: function(e) {
e.stopPropagation();
editor.insertContent(this.value());
}
},
{
text: 'Second submenu item',
value: 'Text from sub sub menu',
icon: 'icon dashicons-edit',
onclick: function(e) {
e.stopPropagation();
editor.insertContent(this.value());
}
}
]
},
{
text: 'Menu item III',
value: 'Text from menu item III',
icon: 'icon dashicons-tickets',
onclick: function() {
editor.insertContent(this.value());
}
}
]
});
});
})();