Dashboard: Always replace title

This is needed if an error occurs and the exception title was rendered
into the container.
This commit is contained in:
Marius Hein 2015-02-02 11:57:50 +01:00
parent f9047e85c5
commit c0c0e7d9e5
1 changed files with 5 additions and 4 deletions

View File

@ -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);