Skip to content

Commit

Permalink
Some AAM refactoring #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Sekachev committed Sep 26, 2018
1 parent 6651637 commit c24943c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cvat/apps/engine/static/engine/js/shapeCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1295,22 +1295,18 @@ class ShapeCollectionView {
static sortByZOrder() {
if (window.cvat.job.z_order) {
let content = $('#frameContent');

let shapes = content.find('.shape, .pointTempGroup, .shapeCreation, .aim').toArray().sort(
(a,b) => (+a.attributes.z_order.nodeValue - +b.attributes.z_order.nodeValue)
);
let children = content.children().filter((el) => !(el in shapes));

for (let shape of shapes) {
content.append(shape);
}

let mask = $('#outsideRect');
if (mask.length) {
mask.appendTo(mask.parent());
}

let texts = content.find('.shapeText');
for (let text of texts) {
content.append(text);
for (let child of children) {
content.append(child);
}
}
}
Expand Down

0 comments on commit c24943c

Please sign in to comment.