collapsibleContainer.js: Don't expect a data attribute for a container's id
This commit is contained in:
parent
e6e43d07bf
commit
ffe638ee36
|
@ -33,9 +33,14 @@
|
|||
CollapsibleContainer.prototype.onRendered = function(event) {
|
||||
var _this = event.data.self;
|
||||
|
||||
$(event.target).find('.collapsible-container[data-collapsible-id]').each(function() {
|
||||
$(event.target).find('.collapsible-container').each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if (typeof $this.attr('id') === 'undefined') {
|
||||
_this.icinga.logger.warn('[collapsible] Container has no id: ', this);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this.find('.collapsible').length > 0) {
|
||||
$this.addClass('has-collapsible');
|
||||
if ($this.find('.collapsible').innerHeight() > ($this.data('height') || _this.defaultHeight)) {
|
||||
|
@ -51,9 +56,14 @@
|
|||
_this.updateCollapsedState($this);
|
||||
});
|
||||
|
||||
$(event.target).find('.collapsible-table-container[data-collapsible-id]').each(function() {
|
||||
$(event.target).find('.collapsible-table-container').each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if (typeof $this.attr('id') === 'undefined') {
|
||||
_this.icinga.logger.warn('[collapsible] Container has no id: ', this);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this.find('.collapsible').length > 0) {
|
||||
$this.addClass('has-collapsible');
|
||||
if ($this.find('tr').length > ($this.attr('data-numofrows') || _this.defaultNumOfRows)) {
|
||||
|
@ -101,7 +111,7 @@
|
|||
$collapsible = $container;
|
||||
}
|
||||
|
||||
var collapsibleId = $container.data('collapsibleId');
|
||||
var collapsibleId = $container.attr('id');
|
||||
if (typeof this.expandedContainers[collapsibleId] === 'undefined') {
|
||||
this.expandedContainers[collapsibleId] = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue