Skip to content

Commit

Permalink
Modify handlerUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
dangvanthanh committed Aug 20, 2018
1 parent c120b90 commit b028ab5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 72 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ export default {

### Props

| Name | Type | Description |
| ----------------------- | ---------- | ------------------------------------------------------------------------ |
| `name` | `String` | Name of instance ckedior. **Default: editor-1** |
| `id` | `String` | Id of instance ckedior. **Default: editor-1** |
| `types` | `String` | Types of ckedior. **Default: classic** |
| `config` | `Object` | All configuration of ckeditor. **Default: {}** |
| `instanceReadyCallback` | `Function` | Optional function that will be attached to CKEditor instanceReady event. |
| Name | Type | Description |
| ----------------------- | ---------- | ---------------------------------------------------------------------------- |
| `name` | `String` | Name of instance ckedior. **Default: editor- ** |
| `id` | `String` | Id of instance ckedior. **Default: editor-1** |
| `types` | `String` | Types of ckedior. **Default: classic** |
| `config` | `Object` | All configuration of ckeditor. **Default: {}** |
| `instanceReadyCallback` | `Function` | Optional function that will be attached to CKEditor instanceReady event. |
| `readOnlyMode` | `Boolean` | Option setReadOnly editor initializes in the proper mode. **Default: false** |

## Build Setup

Expand All @@ -97,6 +98,7 @@ Thanks to:
- [rlfscin](https://github.com/rlfscin)
- [Renato Souza](https://github.com/renatosistemasvc)
- [Fernando Morgenstern](https://github.com/fernandomm)
- [Christoph-Wagner](https://github.com/Christoph-Wagner)

## License

Expand Down
24 changes: 8 additions & 16 deletions dist/vue-ckeditor2.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ var script = {
}
},
watch: {
value: {
handler: undefined.handlerUpdate(val),
immediate: true
value: function value(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
readOnlyMode: {
handler: undefined.handlerReadOnlyMode(val),
immediate: true
readOnlyMode: function readOnlyMode(val) {
this.instance.setReadOnly(val);
}
},
mounted: function mounted() {
Expand Down Expand Up @@ -153,16 +155,6 @@ var script = {
_this2.onChange();
});
}
},
handlerUpdate: function handlerUpdate(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
handlerReadOnlyMode: function handlerReadOnlyMode(val) {
this.instance.setReadOnly(val);
}
}
};
Expand Down
24 changes: 8 additions & 16 deletions dist/vue-ckeditor2.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ var script = {
}
},
watch: {
value: {
handler: undefined.handlerUpdate(val),
immediate: true
value: function value(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
readOnlyMode: {
handler: undefined.handlerReadOnlyMode(val),
immediate: true
readOnlyMode: function readOnlyMode(val) {
this.instance.setReadOnly(val);
}
},
mounted: function mounted() {
Expand Down Expand Up @@ -149,16 +151,6 @@ var script = {
_this2.onChange();
});
}
},
handlerUpdate: function handlerUpdate(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
handlerReadOnlyMode: function handlerReadOnlyMode(val) {
this.instance.setReadOnly(val);
}
}
};
Expand Down
24 changes: 8 additions & 16 deletions dist/vue-ckeditor2.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@
}
},
watch: {
value: {
handler: undefined.handlerUpdate(val),
immediate: true
value: function value(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
readOnlyMode: {
handler: undefined.handlerReadOnlyMode(val),
immediate: true
readOnlyMode: function readOnlyMode(val) {
this.instance.setReadOnly(val);
}
},
mounted: function mounted() {
Expand Down Expand Up @@ -158,16 +160,6 @@
_this2.onChange();
});
}
},
handlerUpdate: function handlerUpdate(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
handlerReadOnlyMode: function handlerReadOnlyMode(val) {
this.instance.setReadOnly(val);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-ckeditor2",
"version": "2.0.8",
"version": "2.0.9",
"description": "Ckeditor 4 using with Vue.js",
"author": "Dang Van Thanh <[email protected]>",
"main": "dist/vue-ckeditor2.cjs.js",
Expand Down
24 changes: 8 additions & 16 deletions src/VueCkeditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ export default {
}
},
watch: {
value: {
handler: this.handlerUpdate(val),
immediate: true
value(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
readOnlyMode: {
handler: this.handlerReadOnlyMode(val),
immediate: true
readOnlyMode(val) {
this.instance.setReadOnly(val);
}
},
mounted() {
Expand Down Expand Up @@ -135,16 +137,6 @@ export default {
this.onChange();
});
}
},
handlerUpdate(val) {
try {
if (this.instance) {
this.update(val);
}
} catch (e) {}
},
handlerReadOnlyMode(val) {
this.instance.setReadOnly(val);
}
}
};
Expand Down

0 comments on commit b028ab5

Please sign in to comment.