Skip to content
Snippets Groups Projects
Verified Commit 6fb2bfda authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #122 view administration doctype

parent d27f73b8
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,16 @@ var DoctypesAdministrationComponent = /** @class */ (function () {
},
"plugins": ["search", "dnd", "contextmenu"],
});
var to = false;
$j('#jstree_search').keyup(function () {
if (to) {
clearTimeout(to);
}
to = setTimeout(function () {
var v = $j('#jstree_search').val();
$j('#jstree').jstree(true).search(v);
}, 250);
});
$j('#jstree')
.on('select_node.jstree', function (e, data) {
_this.loadDoctype(data.node);
......@@ -78,16 +88,6 @@ var DoctypesAdministrationComponent = /** @class */ (function () {
.jstree();
}, 0);
$j('#jstree').jstree('select_node', _this.doctypes[0]);
var to = false;
$j('#jstree_search').keyup(function () {
if (to) {
clearTimeout(to);
}
to = setTimeout(function () {
var v = $j('#jstree_search').val();
$j('#jstree').jstree(true).search(v);
}, 250);
});
_this.loading = false;
}, function () {
location.href = "index.php";
......
......@@ -76,6 +76,14 @@ export class DoctypesAdministrationComponent implements OnInit {
},
"plugins": ["search", "dnd", "contextmenu"],
});
var to: any = false;
$j('#jstree_search').keyup(function () {
if (to) { clearTimeout(to); }
to = setTimeout(function () {
var v = $j('#jstree_search').val();
$j('#jstree').jstree(true).search(v);
}, 250);
});
$j('#jstree')
// listen for event
.on('select_node.jstree', (e: any, data: any) => {
......@@ -90,14 +98,6 @@ export class DoctypesAdministrationComponent implements OnInit {
.jstree();
}, 0);
$j('#jstree').jstree('select_node', this.doctypes[0]);
var to: any = false;
$j('#jstree_search').keyup(function () {
if (to) { clearTimeout(to); }
to = setTimeout(function () {
var v = $j('#jstree_search').val();
$j('#jstree').jstree(true).search(v);
}, 250);
});
this.loading = false;
}, () => {
location.href = "index.php";
......
......@@ -43,6 +43,7 @@ class FirstLevelController
$firstLevelValue['id'] = 'firstlevel_'.$firstLevelValue['doctypes_first_level_id'];
$firstLevelValue['text'] = $firstLevelValue['doctypes_first_level_label'];
$firstLevelValue['parent'] = '#';
$firstLevelValue['state']['opened'] = true;
array_push($structure, $firstLevelValue);
}
foreach ($secondLevels as $secondLevelValue) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment