fix bug 2.0.9反复点击相同节点报错
# Conflicts:
#	js/app.js
This commit is contained in:
hjx 2019-05-17 11:50:56 +08:00
parent 6a3f5cbf5b
commit b4acfa5612

View File

@ -160,11 +160,14 @@ let app = new Vue({
handleNodeClick(node) {
if (node) {
this.$data.node = node;
if (!node.hex_color) {
cc.js.getset(node, 'hex_color', () => {
return '#' + node.color.toHEX('#rrggbb');
}, (hex) => {
node.color = new cc.Color().fromHEX(hex);
}, false, true);
}
let superPreLoad = node._onPreDestroy;
node._onPreDestroy = () => {
superPreLoad.apply(node);
@ -182,6 +185,7 @@ let app = new Vue({
for (let i = 0; i < schema.rows.length; i++) {
for (let j = 0; j < schema.rows[i].length; j++) {
if (schema.rows[i][j].type === 'color') {
if (!node[schema.key][schema.rows[i][j].field]) {
cc.js.getset(node[schema.key], schema.rows[i][j].field, () => {
return '#' + node.getComponent(schema.key)[schema.rows[i][j]
.rawField].toHEX('#rrggbb');
@ -192,6 +196,7 @@ let app = new Vue({
}
}
}
}
} else {
schema = {
title: component.__classname__,
@ -301,11 +306,14 @@ let app = new Vue({
},
openDevMode() {
setTimeout(() => {
if (!cc.Node.prototype.isLeaf) {
cc.js.getset(cc.Node.prototype, 'isLeaf', function() {
return this.childrenCount === 0;
}, function(value) {
}, false, true);
}
let top = document.getElementById('top')
top.appendChild(document.getElementsByClassName('toolbar')[0]);
document.getElementById('game_panel').appendChild(document.getElementById('content'));