loader.js: Only pre-wrap a search response's html with a div
It's not required for all responses anymore. refs #3953
This commit is contained in:
parent
d699191629
commit
b15c012671
|
@ -445,8 +445,6 @@
|
|||
_this.loadUrl(_this.url('/layout/announcements'), $('#announcements'));
|
||||
}
|
||||
|
||||
// div helps getting an XML tree
|
||||
var $resp = $('<div>' + req.responseText + '</div>');
|
||||
var active = false;
|
||||
var rendered = false;
|
||||
var classes;
|
||||
|
@ -521,11 +519,9 @@
|
|||
}
|
||||
|
||||
// Handle search requests, still hardcoded.
|
||||
if (req.url.match(/^\/search/) &&
|
||||
req.$target.data('icingaUrl').match(/^\/search/) &&
|
||||
$('.dashboard', $resp).length > 0 &&
|
||||
$('.dashboard .container', req.$target).length > 0)
|
||||
{
|
||||
if (req.url.match(/^\/search/) && req.$target.data('icingaUrl').match(/^\/search/)) {
|
||||
var $resp = $('<div>' + req.responseText + '</div>'); // div helps getting an XML tree
|
||||
if ($('.dashboard', $resp).length > 0 && $('.dashboard .container', req.$target).length > 0) {
|
||||
// TODO: We need dashboard pane and container identifiers (not ids)
|
||||
var targets = [];
|
||||
$('.dashboard .container', req.$target).each(function (idx, el) {
|
||||
|
@ -549,6 +545,7 @@
|
|||
});
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
|
||||
var referrer = req.referrer;
|
||||
if (typeof referrer === 'undefined') {
|
||||
|
@ -574,8 +571,7 @@
|
|||
this.icinga.timer.unregister(req.progressTimer);
|
||||
}
|
||||
|
||||
// .html() removes outer div we added above
|
||||
this.renderContentToContainer($resp.html(), req.$target, req.action, req.autorefresh, req.forceFocus, autoSubmit);
|
||||
this.renderContentToContainer(req.responseText, req.$target, req.action, req.autorefresh, req.forceFocus, autoSubmit);
|
||||
if (oldNotifications) {
|
||||
oldNotifications.appendTo($('#notifications'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue