renovations

This commit is contained in:
Ilya Kantor 2015-02-21 14:58:02 +03:00
parent a62682e188
commit 35081a779a
115 changed files with 439 additions and 325 deletions

View file

@ -0,0 +1,23 @@
var result = {
0: { children: [] }
};
$('div[id^="region"]').each(function() {
el = $(this);
var id = el.attr('id').slice(6);
result[id] = {
title: el.children('label').html(),
children: [],
id: id
};
var parent = el.parent().closest('div[id^="region"]');
if (parent.length) {
var pid = parent.attr('id').slice(6);
} else {
pid = 0;
}
result[pid].children.push(+id);
});