mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
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);
|
$container.append(content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.icinga.ui.assignUniqueContainerIds();
|
||||||
|
|
||||||
if (scrollPos !== false) {
|
if (scrollPos !== false) {
|
||||||
$container.scrollTop(scrollPos);
|
$container.scrollTop(scrollPos);
|
||||||
|
@ -479,6 +479,35 @@
|
|||||||
return focusedTableDataUrl;
|
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 () {
|
refreshDebug: function () {
|
||||||
|
|
||||||
var size = this.getDefaultFontSize().toString();
|
var size = this.getDefaultFontSize().toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user