Error fixes

This commit is contained in:
Alejandro Gallardo Escobar 2015-01-19 17:33:23 +01:00
parent 32952e1714
commit 5f1c426fe9

View File

@ -30,6 +30,7 @@ TreeController = {
detailRecipient: '', detailRecipient: '',
filter: {}, filter: {},
counterTitles: {}, counterTitles: {},
shouldHaveCounters: true,
reload: function () { reload: function () {
// Bad recipient // Bad recipient
if (typeof this.recipient == 'undefined' || this.recipient.length == 0) { if (typeof this.recipient == 'undefined' || this.recipient.length == 0) {
@ -403,7 +404,10 @@ TreeController = {
} }
// Load the status counters // Load the status counters
_processNodeCounters($content, element.counters, element.type); var hasCounters = _processNodeCounters($content, element.counters, element.type);
if (controller.shouldHaveCounters && !hasCounters)
return;
// If exist the detail container, show the data // If exist the detail container, show the data
if (typeof controller.detailRecipient != 'undefined' && controller.detailRecipient.length > 0) { if (typeof controller.detailRecipient != 'undefined' && controller.detailRecipient.length > 0) {
@ -791,6 +795,9 @@ TreeNodeDetailController = {
if (typeof data.counterTitles != 'undefined') { if (typeof data.counterTitles != 'undefined') {
this.counterTitles = data.counterTitles; this.counterTitles = data.counterTitles;
} }
if (typeof data.shouldHaveCounters != 'undefined') {
this.shouldHaveCounters = data.shouldHaveCounters;
}
if (typeof TreeNodeDetailController.controllers[this.type] == 'undefined') if (typeof TreeNodeDetailController.controllers[this.type] == 'undefined')
TreeNodeDetailController.controllers[this.type] = {}; TreeNodeDetailController.controllers[this.type] = {};