Skip to content

Commit 8b3e514

Browse files
Update internal methods
1 parent 7af7071 commit 8b3e514

5 files changed

Lines changed: 37 additions & 5 deletions

File tree

docs/api/internal/detach.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_label: api.detach() ?
2+
sidebar_label: api.detach()
33
title: on Method
44
description: You can learn about the on method in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
55
---
@@ -8,10 +8,42 @@ description: You can learn about the on method in the documentation of the DHTML
88

99
### Description
1010

11+
@short: Allows removing/detaching event handlers
12+
1113
### Usage
1214

15+
~~~jsx {}
16+
api.detach( event: string ): void;
17+
~~~
18+
1319
### Parameters
1420

21+
- `event` - (required) an event to be detached
22+
1523
### Events
1624

25+
:::info
26+
The full list of RichText internal events can be found [**here**](/category/richtext-events/)
27+
:::
28+
1729
### Example
30+
31+
~~~jsx {16-17}
32+
// initialize RichText
33+
const editor = new richtext.Richtext("#root", {
34+
// configuration parameters
35+
});
36+
37+
// subscribe on the "set-font-size" event
38+
editor.api.on("set-font-size", (obj) => {
39+
console.log(obj.fontSize);
40+
});
41+
42+
// set the text font size
43+
editor.api.exec("set-font-size", {
44+
fontSize: "36px"
45+
});
46+
47+
// detach the "set-font-size" event
48+
editor.api.detach("set-font-size");
49+
~~~

docs/api/internal/exec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ api.exec(
2727
### Events
2828

2929
:::info
30-
The full list of the RichText internal events can be found [**here**](/category/richtext-events/)
30+
The full list of RichText internal events can be found [**here**](/category/richtext-events/)
3131
:::
3232

3333
### Example

docs/api/internal/intercept.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ api.intercept(
2727
### Events
2828

2929
:::info
30-
The full list of the RichText internal events can be found [**here**](api/overview/main_overview.md/#richtext-events)
30+
The full list of RichText internal events can be found [**here**](/category/richtext-events/)
3131
:::
3232

3333
### Example

docs/api/internal/on.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ api.on(
2727
### Events
2828

2929
:::info
30-
The full list of the RichText internal events can be found [**here**](/category/richtext-events/)
30+
The full list of RichText internal events can be found [**here**](/category/richtext-events/)
3131
:::
3232

3333
### Example

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = {
7070
image: "/img/docusaurus.png"
7171
},
7272
items: [
73-
//"api/internal/detach",
73+
"api/internal/detach",
7474
"api/internal/exec",
7575
"api/internal/intercept",
7676
"api/internal/on",

0 commit comments

Comments
 (0)