Skip to content

Commit b1a330b

Browse files
author
Farzad Hayatbakhsh
committed
DOC-1928: Create table for Sidebar specification object
1 parent 2d858c7 commit b1a330b

File tree

1 file changed

+21
-32
lines changed

1 file changed

+21
-32
lines changed

modules/ROOT/pages/customsidebar.adoc

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,30 @@ When a new sidebar is registered, a corresponding toolbar button for toggling th
1818

1919
=== Specification object
2020

21-
[[tooltip]]
22-
==== `+tooltip+`
21+
[cols="1,1,4", options="header"]
22+
|===
23+
| Property | Type | Description
2324

24-
The `+tooltip+` specifies a tooltip to be displayed when hovering over the sidebar toggle button.
25+
| `+tooltip+`
26+
| `+String+`
27+
| Specifies a tooltip to be displayed when hovering over the sidebar toggle button.
2528

26-
*Type:* `+String+`
29+
| `+icon+`
30+
| `+String+`
31+
| Specifies an icon for the sidebar toggle button. The icon should be the name of an icon provided by the {productname} skin or a xref:apis/tinymce.editor.ui.registry.adoc#addIcon[custom icon].
2732

28-
[[icon]]
29-
==== `+icon+`
33+
| `+onSetup+`
34+
| `+Function+`
35+
| Specifies a function to be called when the panel is first created. It passes in an API object and should return a callback that takes an API. The default is `+(api) => (api) => {}+`. This function runs whenever the sidebar is rendered, and the returned callback is executed when the sidebar is destroyed. Therefore, the returned function is essentially an `+onTeardown+` handler, and can be used to unbind events and callbacks.
3036

31-
The `+icon+` specifies an icon for the sidebar toggle button. The icon should be the name of an icon provided by the {productname} skin or a xref:apis/tinymce.editor.ui.registry.adoc#addIcon[custom icon].
37+
| `+onShow+`
38+
| `+Function+`
39+
| Specifies a function to be called when the panel is displayed. It passes in an API object.
3240

33-
*Type:* `+String+`
34-
35-
[[onSetup]]
36-
==== `+onSetup+`
37-
38-
The `+onSetup+` specifies a function to be called when the panel is first created. It passes in an API object and should return a callback that takes an API. The default is `+(api) => (api) => {}+`.
39-
40-
`+onSetup+` is a complex property. It requires a function that takes the sidebar’s API and should return a callback that takes the sidebar's API and returns nothing. This occurs because `+onSetup+` runs whenever the sidebar is rendered, and the returned callback is executed when the sidebar is destroyed. Therefore the returned function is essentially an `+onTeardown+` handler, and can be used to unbind events and callbacks.
41-
42-
*Type:* `+Function+`
43-
44-
[[onShow]]
45-
==== `+onShow+`
46-
47-
The `+onShow+` specifies a function to be called when the panel displayed. It passes in an API object.
48-
49-
*Type:* `+Function+`
50-
51-
[[onHide]]
52-
==== `+onHide+`
53-
54-
The `+onHide+` specifies a function to be called when the panel is hidden. It passes in an API object.
55-
56-
*Type:* `+Function+`
41+
| `+onHide+`
42+
| `+Function+`
43+
| Specifies a function to be called when the panel is hidden. It passes in an API object.
44+
|===
5745

5846
=== API Object
5947

@@ -72,7 +60,8 @@ include::partial$configuration/sidebar_show.adoc[leveloffset=+1]
7260
[source,js]
7361
----
7462
tinymce.init({
75-
...
63+
selector: 'textarea', // change this value according to your HTML
64+
sidebar_show: 'mysidebar',
7665
toolbar: 'mysidebar',
7766
setup: (editor) => {
7867
editor.ui.registry.addSidebar('mysidebar', {

0 commit comments

Comments
 (0)