better empty check
This commit is contained in:
parent
ff784a1073
commit
4e8a56bfc7
1 changed files with 14 additions and 1 deletions
|
@ -416,7 +416,20 @@ Part.prototype.setCutOnFold = function (p1, p2) {
|
|||
}
|
||||
|
||||
Part.prototype.isEmpty = function() {
|
||||
return Object.keys(this.paths).length === 0 && Object.keys(this.snippets).length === 0
|
||||
if (Object.keys(this.snippets).length > 0) return false
|
||||
|
||||
if (Object.keys(this.paths).length > 0) return false
|
||||
|
||||
for (var p in this.paths) {
|
||||
if (paths[p].length()) return false
|
||||
}
|
||||
|
||||
for (var p in this.points) {
|
||||
if (points[p].attributes.get('data-text')) return false
|
||||
if (points[p].attributes.get('data-circle')) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export default Part
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue