Assign unique ids to dashlets and subcontainers
Without this we have no chance to cancel pending requests for dashlets. fixes #6552
This commit is contained in:
parent
ef0963af38
commit
473a705e2e
|
@ -665,6 +665,7 @@
|
|||
$container.append(content);
|
||||
}
|
||||
}
|
||||
this.icinga.ui.assignUniqueContainerIds();
|
||||
|
||||
if (scrollPos !== false) {
|
||||
$container.scrollTop(scrollPos);
|
||||
|
|
|
@ -479,6 +479,35 @@
|
|||
return focusedTableDataUrl;
|
||||
},
|
||||
|
||||
/**
|
||||
* Assign a unique ID to each .container without such
|
||||
*
|
||||
* This usually applies to dashlets
|
||||
*/
|
||||
assignUniqueContainerIds: function() {
|
||||
var currentMax = 0;
|
||||
$('.container').each(function() {
|
||||
var $el = $(this);
|
||||
var m;
|
||||
if (!$el.attr('id')) {
|
||||
return;
|
||||
}
|
||||
if (m = $el.attr('id').match(/^ciu_(\d+)$/)) {
|
||||
if (parseInt(m[1]) > currentMax) {
|
||||
currentMax = parseInt(m[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.container').each(function() {
|
||||
var $el = $(this);
|
||||
if (!!$el.attr('id')) {
|
||||
return;
|
||||
}
|
||||
currentMax++;
|
||||
$el.attr('id', 'ciu_' + currentMax);
|
||||
});
|
||||
},
|
||||
|
||||
refreshDebug: function () {
|
||||
|
||||
var size = this.getDefaultFontSize().toString();
|
||||
|
|
Loading…
Reference in New Issue