Skip to content

Commit

Permalink
Release v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
m3esma committed Jan 20, 2018
1 parent 850ff34 commit ac2210a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/vue-easy-tinymce.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-easy-tinymce",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple and powerful package for easy usage of tinymce in Vue.js project.",
"main": "dist/vue-easy-tinymce.min.js",
"scripts": {
Expand Down
19 changes: 9 additions & 10 deletions src/vue-easy-tinymce.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-easy-tinymce v1.0.1
* vue-easy-tinymce v1.0.2
* Copyright (c) 2018-present Mehdi Esmaeili (@m3esma)
* Released under the MIT License.
* Project: https://github.com/m3esma/vue-easy-tinymce
Expand Down Expand Up @@ -34,7 +34,6 @@ var VueEasyTinyMCE = {
//template: '<div><textarea rows="10" v-bind:value="value"></textarea></div>', //inside a div
template: '<textarea :id="computedId" :value="value"></textarea>',


computed: {
//for multi instance support
computedId: function () {
Expand All @@ -57,8 +56,7 @@ var VueEasyTinyMCE = {
plugins: this.plugins,
init_instance_callback: function (editor) {
editor.on('Change KeyUp Undo Redo', function (e) {
//component.updateValue(editor.getContent());
component.value = editor.getContent();
component.updateValue(editor.getContent());
});
//editor.setContent(component.value); //use instead :value="value"
//alert("init");
Expand All @@ -77,19 +75,20 @@ var VueEasyTinyMCE = {
.toString(16)
.substring(1);
}

return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
},
updateValue: function (value) {
this.$emit('input', value);
}
},

watch: {
value: function(newValue, oldValue) {
var component = this;
value: function (newValue, oldValue) {
// if v-model content change programmability
if(component.value !== this.objTinymce.getContent())
this.objTinymce.setContent(component.value);
else
component.$emit('input', newValue);
if (this.value !== this.objTinymce.getContent())
this.objTinymce.setContent(this.value);
}
}

Expand Down

0 comments on commit ac2210a

Please sign in to comment.