mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Fixes
This commit is contained in:
parent
530454ea72
commit
9b8f53691a
@ -26,7 +26,7 @@ TreeController = {
|
|||||||
errorMessage: "Error",
|
errorMessage: "Error",
|
||||||
baseURL: "",
|
baseURL: "",
|
||||||
ajaxURL: "ajax.php",
|
ajaxURL: "ajax.php",
|
||||||
ajaxPage: "include/ajax/tree.ajax.php",
|
ajaxPage: "include/ajax/tree.ajax",
|
||||||
detailRecipient: '',
|
detailRecipient: '',
|
||||||
reload: function () {
|
reload: function () {
|
||||||
// Bad recipient
|
// Bad recipient
|
||||||
@ -60,7 +60,7 @@ TreeController = {
|
|||||||
elements.forEach(function(element, index) {
|
elements.forEach(function(element, index) {
|
||||||
lastNode = index == elements.length - 1 ? true : false;
|
lastNode = index == elements.length - 1 ? true : false;
|
||||||
firstNode = rootGroup && index == 0 ? true : false;
|
firstNode = rootGroup && index == 0 ? true : false;
|
||||||
element.jqObject = _processNode($group, detailRecipient, element, lastNode, firstNode);
|
element.jqObject = _processNode($group, detailContainer, element, lastNode, firstNode);
|
||||||
}, $group);
|
}, $group);
|
||||||
|
|
||||||
return $group;
|
return $group;
|
||||||
@ -119,7 +119,7 @@ TreeController = {
|
|||||||
$node.addClass("leaf-closed");
|
$node.addClass("leaf-closed");
|
||||||
|
|
||||||
// Add children
|
// Add children
|
||||||
var $children = _processGroup($node, this.detailContainer, element.children, this.baseURL);
|
var $children = _processGroup($node, detailContainer, element.children, this.baseURL);
|
||||||
$node.data('children', $children);
|
$node.data('children', $children);
|
||||||
|
|
||||||
$leafIcon.click(function () {
|
$leafIcon.click(function () {
|
||||||
@ -142,7 +142,9 @@ TreeController = {
|
|||||||
else if (typeof element.searchChildren != 'undefined' && element.searchChildren) {
|
else if (typeof element.searchChildren != 'undefined' && element.searchChildren) {
|
||||||
$node.addClass("leaf-closed");
|
$node.addClass("leaf-closed");
|
||||||
|
|
||||||
$leafIcon.click(function () {
|
$leafIcon.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
if (! $node.hasClass("children-loaded")) {
|
if (! $node.hasClass("children-loaded")) {
|
||||||
$node
|
$node
|
||||||
.removeClass("leaf-closed")
|
.removeClass("leaf-closed")
|
||||||
@ -150,23 +152,24 @@ TreeController = {
|
|||||||
.addClass("leaf-loading");
|
.addClass("leaf-loading");
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: this.ajaxURL,
|
url: controller.ajaxURL,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
page: this.ajaxPage,
|
page: controller.ajaxPage,
|
||||||
getChildren: 1,
|
getChildren: 1,
|
||||||
id: element.id,
|
id: element.id,
|
||||||
type: element.type
|
type: element.type
|
||||||
},
|
},
|
||||||
complete: function(xhr, textStatus) {
|
complete: function(xhr, textStatus) {
|
||||||
$node.removeClass("leaf-loading");
|
$node.removeClass("leaf-loading");
|
||||||
|
$node.addClass("children-loaded")
|
||||||
},
|
},
|
||||||
success: function(data, textStatus, xhr) {
|
success: function(data, textStatus, xhr) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
$node.addClass("leaf-open");
|
$node.addClass("leaf-open");
|
||||||
|
|
||||||
var $children = _processGroup($node, this.detailContainer, data.elements, this.baseURL);
|
var $children = _processGroup($node, detailContainer, data.tree, controller.baseURL);
|
||||||
$children.slideDown();
|
$children.slideDown();
|
||||||
|
|
||||||
$node.data('children', $children);
|
$node.data('children', $children);
|
||||||
@ -298,7 +301,7 @@ TreeNodeDetailController = {
|
|||||||
errorMessage: "Error",
|
errorMessage: "Error",
|
||||||
baseURL: "",
|
baseURL: "",
|
||||||
ajaxURL: "ajax.php",
|
ajaxURL: "ajax.php",
|
||||||
ajaxPage: "include/ajax/tree.ajax.php",
|
ajaxPage: "include/ajax/tree.ajax",
|
||||||
container: '',
|
container: '',
|
||||||
reload: function () {
|
reload: function () {
|
||||||
// Label
|
// Label
|
||||||
|
@ -2895,6 +2895,10 @@ table#policy_modules td * {
|
|||||||
background-image: url(../../images/tree/first_leaf.png);
|
background-image: url(../../images/tree/first_leaf.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tree-node.leaf-error>.leaf-icon {
|
||||||
|
background-image: url(../../images/tree/last_leaf.png);
|
||||||
|
}
|
||||||
|
|
||||||
.tree-node>.leaf-icon {
|
.tree-node>.leaf-icon {
|
||||||
background-position: 0px 0px;
|
background-position: 0px 0px;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
@ -1056,8 +1056,7 @@ echo "<div id='tree-controller-detail-recipient'></div>";
|
|||||||
recipient: $("div#tree-controller-recipient"),
|
recipient: $("div#tree-controller-recipient"),
|
||||||
detailRecipient: $("div#tree-controller-detail-recipient"),
|
detailRecipient: $("div#tree-controller-detail-recipient"),
|
||||||
tree: tree,
|
tree: tree,
|
||||||
baseURL: "<?php echo $config['homeurl'].'/'; ?>",
|
baseURL: "<?php echo $config['homeurl']; ?>/",
|
||||||
ajaxURL: "<?php echo $config['homeurl']; ?>/ajax.php",
|
ajaxURL: "<?php echo $config['homeurl']; ?>/ajax.php"
|
||||||
ajaxPage: "<?php echo $config['homeurl']; ?>/include/ajax/tree.ajax.php"
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -139,7 +139,7 @@ echo "</div>";
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo ui_get_full_url("ajax.php", false, false, false); ?>",
|
url: "<?php echo $config['homeurl']; ?>/ajax.php",
|
||||||
data: parameters,
|
data: parameters,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@ -148,7 +148,9 @@ echo "</div>";
|
|||||||
treeController.init({
|
treeController.init({
|
||||||
recipient: $("div#tree-controller-recipient"),
|
recipient: $("div#tree-controller-recipient"),
|
||||||
page: page,
|
page: page,
|
||||||
tree: data.tree
|
tree: data.tree,
|
||||||
|
baseURL: "<?php echo $config['homeurl']; ?>/",
|
||||||
|
ajaxURL: "<?php echo $config['homeurl']; ?>/ajax.php"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user