From b21d4d6f5ad8d9e66c414a68953343c845486ba1 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 8 Jan 2015 18:23:01 +0100 Subject: [PATCH] Fixed some errors on the tree node detail controller --- .../include/javascript/tree/TreeController.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 51c0d69579..d495789347 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -638,6 +638,16 @@ TreeNodeDetailController = { var $content = $("
"); $content.addClass("tree-element-detail-content"); + // Container + this.container = $("
"); + this.container + .addClass("tree-element-detail") + .append($label) + .data('label', $label) + .append($content) + .data('content', $content) + .hide(); + $label.addClass('tree-element-detail-loading'); $.ajax({ url: this.ajaxURL, @@ -655,7 +665,8 @@ TreeNodeDetailController = { success: function(data, textStatus, xhr) { if (data.success) { $label.addClass('tree-element-detail-loaded'); - $content.append(data.html); + $content.html(data.html); + controller.open(); } else { @@ -669,17 +680,6 @@ TreeNodeDetailController = { } }); - - // Container - this.container = $("
"); - this.container - .addClass("tree-element-detail") - .append($label) - .data('label', $label) - .append($content) - .data('content', $content) - .hide(); - this.recipient.append(this.container); this.open(); }, @@ -734,7 +734,7 @@ TreeNodeDetailController = { return false; } // Required - if (typeof data.id != 'undefined' && data.id.length > 0) { + if (typeof data.id != 'undefined' && (data.id.length > 0 || !isNaN(data.id))) { this.id = data.id; } else {