Skip to content

Commit

Permalink
新增blur与focus事件文档
Browse files Browse the repository at this point in the history
  • Loading branch information
hold-baby committed Oct 22, 2017
1 parent 7f6625f commit 7c5befb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
21 changes: 21 additions & 0 deletions docs/usage/03-config/09-focus.md
@@ -0,0 +1,21 @@
# 配置 focus 函数

配置`focus`函数之后,用户点击富文本区域会触发`focus`函数执行。

```html
<div id="div1">
<p>欢迎使用 wangEditor 富文本编辑器</p>
</div>

<script type="text/javascript" src="/wangEditor.min.js"></script>
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1')
editor.customConfig.focus = function () {
console.log("focus")
}
editor.create()
</script>
```

25 changes: 25 additions & 0 deletions docs/usage/03-config/10-blur.md
@@ -0,0 +1,25 @@
# 配置 blur 函数

配置`blur`函数之后,如果当前有手动获取焦点的富文本并且鼠标点击富文本以外的区域,则会触发`blur`函数执行。

```html
<div id="div1">
<p>欢迎使用 wangEditor 富文本编辑器</p>
</div>

<p>手动触发 onchange 函数执行</p>
<button id="btn1">change</button>

<script type="text/javascript" src="/wangEditor.min.js"></script>
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1')
editor.customConfig.blur = function (html) {
// html 即编辑器中的内容
console.log(html)
}
editor.create()
</script>
```

2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "wangeditor",
"title": "wangEditor",
"version": "3.0.11",
"version": "3.0.12",
"description": "wangEditor - 基于javascript和css开发的 web 富文本编辑器, 轻量、简洁、易用、开源免费",
"homepage": "http://wangeditor.github.io/",
"author": {
Expand Down

0 comments on commit 7c5befb

Please sign in to comment.