Skip to content
Snippets Groups Projects
Commit ad7b02a8 authored by pabois's avatar pabois
Browse files

treeview for pages

parent 58dc5107
No related branches found
No related tags found
No related merge requests found
......@@ -12,22 +12,12 @@ window.osuny.pagesTree = {
var $target = $(e.currentTarget),
$branch = $target.closest('.js-treeview-branch');
// e.preventDefault();
// e.stopPropagation();
$branch.toggleClass('treeview__branch--opened');
// if ($branch.hasClass('treeview__branch--opened') && !$branch.hasClass('treeview__branch--loaded')) {
// this.loadBranch($branch, $target.attr('href'));
// }
},
loadBranch: function ($branch, url) {
'use strict';
$.get(url, function (data) {
$('.js-treeview-children', $branch).html(data);
$branch.addClass('treeview__branch--loaded');
});
if ($branch.hasClass('treeview__branch--loaded')) {
e.preventDefault();
e.stopPropagation();
}
},
invoke: function () {
......
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