Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@
*/
showRow: function(tr) {
var dt = this.getDatatablesInstance_();
// NOTE: current dataTables versions could just do dt.row(tr).show().draw(false)
// TODO v5: check can be removed in next major upgrade
if ($.fn.DataTable.versionCheck('2.0')) {
// redraw table
return dt.draw(false);
}

// in older versions, automatic pagination after adding a row was not available
var rowIndex = dt.rows({order: 'current'}).nodes().indexOf(tr);
var pageLength = dt.page.len();
var rowPage = Math.floor(rowIndex / pageLength);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,14 +773,20 @@
sourceIds = [sourceIds];
}
for (var i = 0; i < sourceIds.length; ++i) {
var source = this.mbMap.getModel().getSourceById(sourceIds[i]);
const model = this.mbMap.getModel();
// TODO v5: remove check. model.getSourceBySourceId is available since Mapbender 4.2.5
let source = typeof model.getSourceBySourceId === 'function'
? model.getSourceBySourceId(sourceIds[i])
: model.getSourceById(sourceIds[i]);

if (!source) {
if (!this.mbMap.getModel().findSourceAndLayerIdByName) {
// TODO v5: remove fallback.
if (!model.findSourceAndLayerIdByName) {
console.warn("Method findSourceAndLayerIdByName not available - consider Mapbender upgrade");
} else {
let ids = this.mbMap.getModel().findSourceAndLayerIdByName(sourceIds[i]);
let ids = model.findSourceAndLayerIdByName(sourceIds[i]);
let sourceId = ids.sourceId;
source = sourceId && this.mbMap.getModel().getSourceById(sourceId);
source = sourceId && model.getSourceById(sourceId);
}
}
if (source) {
Expand Down