* adjust for dept and tree browse.
This commit is contained in:
@@ -107,7 +107,8 @@ $(function()
|
||||
data: data,
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
var $toggle = $('<span class="tree-toggle"><span class="dept-name">' + item.name + '</span></span>');
|
||||
var link = item.id !== undefined ? ('<a href="' + createLink('dept', 'browse', 'dept={0}'.format(item.id)) + '">' + item.name + '</a>') : ('<span class="tree-toggle">' + item.name + '</span>');
|
||||
var $toggle = $('<span class="dept-name" data-id="' + item.id + '">' + link + '</span>');
|
||||
if(item.manager)
|
||||
{
|
||||
$toggle.append(' <span class="dept-manager text-muted"><i class="icon icon-user"></i> ' + item.managerName + '</span>');
|
||||
@@ -128,13 +129,6 @@ $(function()
|
||||
title: '<?php echo $lang->dept->edit ?>',
|
||||
template: '<a data-toggle="tooltip" href="javascript:;"><i class="icon icon-pencil"></i>'
|
||||
},
|
||||
add:
|
||||
{
|
||||
title: '<?php echo $lang->dept->manageChild ?>',
|
||||
linkTemplate: '<?php echo helper::createLink('dept', 'browse', "deptID={0}"); ?>',
|
||||
template: '<a data-toggle="tooltip" href="javascript:;"><i class="icon icon-sitemap"></i>',
|
||||
templateInList: false
|
||||
},
|
||||
"delete":
|
||||
{
|
||||
linkTemplate: '<?php echo helper::createLink('dept', 'delete', "deptid={0}"); ?>',
|
||||
@@ -157,10 +151,6 @@ $(function()
|
||||
{
|
||||
window.open(action.linkTemplate.format(item.id), 'hiddenwin');
|
||||
}
|
||||
else if(action.type === 'add')
|
||||
{
|
||||
window.location.href = action.linkTemplate.format(item.id);
|
||||
}
|
||||
else if(action.type === 'sort')
|
||||
{
|
||||
var orders = {};
|
||||
|
||||
@@ -111,7 +111,6 @@
|
||||
$(function()
|
||||
{
|
||||
var data = $.parseJSON('<?php echo json_encode($tree);?>');
|
||||
console.log(data);
|
||||
var options = {
|
||||
name: 'tree-<?php echo $viewType ?>-edit',
|
||||
initialState: 'preserve',
|
||||
@@ -120,10 +119,6 @@ $(function()
|
||||
{
|
||||
var link = item.id !== undefined ? ('<a href="' + createLink('tree', 'browse', 'root=<?php echo $rootID ?>&viewType=<?php echo $viewType ?>&moduleID={0}&branch={1}'.format(item.id, item.branch)) + '">' + item.name + '</a>') : ('<span class="tree-toggle">' + item.name + '</span>');
|
||||
var $toggle = $('<span class="module-name" data-id="' + item.id + '">' + link + '</span>');
|
||||
if(item.short)
|
||||
{
|
||||
$toggle.append(' <span class="module-manager text-muted">(' + item.short + ')</span>');
|
||||
}
|
||||
$li.append($toggle);
|
||||
if(item.nodeType) $li.addClass('tree-item-' + item.nodeType);
|
||||
return true;
|
||||
@@ -141,13 +136,6 @@ $(function()
|
||||
title: '<?php echo $lang->tree->edit ?>',
|
||||
template: '<a data-toggle="tooltip" href="javascript:;"><i class="icon icon-pencil"></i>'
|
||||
},
|
||||
add:
|
||||
{
|
||||
title: '<?php echo strpos($viewType, 'doc') !== false ? $lang->doc->addType : $lang->tree->manageChild;?>',
|
||||
template: '<a data-toggle="tooltip" href="javascript:;"><i class="icon icon-sitemap"></i>',
|
||||
linkTemplate: '<?php echo helper::createLink('tree', 'browse', "rootID=$rootID&viewType=$viewType¤tModuleID={0}&branch={1}"); ?>',
|
||||
templateInList: false
|
||||
},
|
||||
"delete":
|
||||
{
|
||||
linkTemplate: '<?php echo helper::createLink('tree', 'delete', "rootID=$rootID&moduleID={0}"); ?>',
|
||||
@@ -170,11 +158,6 @@ $(function()
|
||||
{
|
||||
window.open(action.linkTemplate.format(item.id), 'hiddenwin');
|
||||
}
|
||||
else if(action.type === 'add')
|
||||
{
|
||||
console.log('>', action.linkTemplate.format(item.id, item.branch));
|
||||
window.location.href = action.linkTemplate.format(item.id, item.branch);
|
||||
}
|
||||
else if(action.type === 'sort')
|
||||
{
|
||||
var orders = {};
|
||||
|
||||
Reference in New Issue
Block a user