We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02f15a0 commit a6b0bf8Copy full SHA for a6b0bf8
src/joint.dia.cell.js
@@ -261,6 +261,27 @@ joint.dia.Cell = Backbone.Model.extend({
261
return this;
262
},
263
264
+ getAncestors: function(){
265
+
266
+ var ancestors = [],
267
+ parentId = this.get('parent');
268
269
+ if(this.collection === undefined)
270
+ return ancestors;
271
272
+ while(parentId !== undefined) {
273
+ var parent = _.find(this.collection.models, function(item){ return item.id === parentId; });
274
+ if(parent !== undefined) {
275
+ ancestors.push(parent);
276
+ parentId = parent.get('parent');
277
+ } else {
278
+ break;
279
+ }
280
281
282
283
+ },
284
285
getEmbeddedCells: function(opt) {
286
287
opt = opt || {};
0 commit comments