From c0c0e7d9e53e1153e7ca7b873e8e39e9e2a37616 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 2 Feb 2015 11:57:50 +0100 Subject: [PATCH] Dashboard: Always replace title This is needed if an error occurs and the exception title was rendered into the container. --- public/js/icinga/loader.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 7d590757b..507a914e3 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -708,11 +708,12 @@ // $container.html(content); } else { - if ($container.closest('.dashboard').length && - ! $('h1', $content).length + if ($container.closest('.dashboard').length ) { - var title = $('h1', $container).first().detach(); - $('h1', $content).first().detach(); + if (! $('h1', $content).length) { + var title = $('h1', $container).first().detach(); + $('h1', $content).first().detach(); + } $container.html(title).append(content); } else if (action === 'replace') { $container.html(content);