* Modify the module tree on the left of the data dictionary.
This commit is contained in:
@@ -16,6 +16,7 @@ function setHeight()
|
||||
var paneHeight = $(window).height() - 90;
|
||||
$('#sidebar .module-tree,#mainContent .module-content').css('height', paneHeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init module tree by zui.
|
||||
*
|
||||
@@ -30,7 +31,6 @@ function initModule()
|
||||
initialState: 'active',
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
console.log(item);
|
||||
$li.append('<a data-module="' + item.key + '" data-has-children="' + (item.children ? !!item.children.length : false) + '" href=# title="' + item.title + '">' + item.title + '</a>');
|
||||
if (item.active) $li.addClass('active open in');
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
$(function()
|
||||
{
|
||||
initTable();
|
||||
setHeight();
|
||||
$(window).resize(setHeight);
|
||||
});
|
||||
@@ -15,3 +16,30 @@ function setHeight()
|
||||
var paneHeight = $(window).height() - 90;
|
||||
$('#sidebar .module-tree,#mainContent .module-content').css('height', paneHeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init table tree by zui.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initTable()
|
||||
{
|
||||
$('#tableTree').tree(
|
||||
{
|
||||
data: tableTree,
|
||||
initialState: 'active',
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
$li.append('<a data-module="' + item.key + '" data-has-children="' + (item.children ? !!item.children.length : false) + '" href=# title="' + item.title + '">' + item.title + '</a>');
|
||||
if (item.active) $li.addClass('active open in');
|
||||
}
|
||||
});
|
||||
|
||||
$('#tableTree').on('click', 'a', function(e)
|
||||
{
|
||||
var target = $(e.target);
|
||||
if (target.attr('data-has-children') === 'true') return;
|
||||
self.location.href = createLink('dev', 'db', 'module=' + target.attr('data-module'));
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user