Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.on('updated', function () {
var selection = self.opts.selection.mapBy('view.domId');
jsp.clearDragSelection();
jsp.addToDragSelection(selection);
var scalingFactor = MINIMAP_SIZE / CANVAS_SIZE;
$('.minimap-element').each(function (i, el) {
var view = JSON.parse($(el).attr('data-view'));
$(el).css({
top: view.top * scalingFactor,
left: view.left * scalingFactor,
width: Math.max(view.width * scalingFactor, 2),
height: Math.max(view.height * scalingFactor, 2)
}).show();
});
});