Skip to content

Commit

Permalink
Fix JS error after merging PR
Browse files Browse the repository at this point in the history
  • Loading branch information
KP73410 committed Dec 18, 2019
1 parent eaa86cd commit e40d27d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
3 changes: 2 additions & 1 deletion demo/assets/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{ text: 'Custom theme', href: 'custom-theme.html' },
{ text: 'Vuex Integration', href: 'vuex.html' },
{ text: 'Exporting', href: 'exporting.html' },
{ text: 'Drag & Drop', href: 'dnd.html' }
{ text: 'Drag & Drop', href: 'dnd.html' },
{ text: 'Updating', href: 'updating.html' },
]

function initMenu() {
Expand Down
8 changes: 4 additions & 4 deletions demo/pages/updating.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
]
}),
mounted() {
this.$nextTick(() => {
this.$refs.tree.update('Item 1', node => {
return { text: 'New Item!' };
setTimeout(() => {
this.$refs.tree.updateData('Item 1', node => {
return { text: 'New Item!' }
});
})
}, 1000)
}
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "liquor-tree",
"description": "A Vue.js tree component.",
"version": "0.2.69",
"version": "0.2.70",
"author": "Kostiantyn <[email protected]>",
"library": "LiquorTree",
"homepage": "https://amsik.github.io/liquor-tree/",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export default class Node {
}

setData (data) {
this.data = Object.assign({}, this.data, data);
this.data = Object.assign({}, this.data, data)

this.$emit('data:changed', this.data);
this.$emit('data:changed', this.data)

return this.data;
return this.data
}

state (name, value) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,11 @@ export default class Tree {
}

updateData (criteria, callback) {
const nodes = this.find(criteria);
const nodes = this.find(criteria)

nodes.forEach(node => node.setData(callback(node)));
nodes.forEach(node => node.setData(callback(node)))

return nodes;
return nodes
}

getNodeById (id) {
Expand Down
6 changes: 1 addition & 5 deletions src/mixins/TreeMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,12 @@ export default {
return this.tree.find(criteria, true)
},

update (criteria, callback) {
return this.tree.update(criteria, callback);
},

expandAll () {
return this.tree.expandAll()
},

updateData (criteria, callback) {
return this.tree.updateData(criteria, callback);
return this.tree.updateData(criteria, callback)
},

collapseAll () {
Expand Down

0 comments on commit e40d27d

Please sign in to comment.