Code Duplication    Length = 16-16 lines in 2 locations

script.js 1 location

@@ 447-462 (lines=16) @@
444
445
        let _i = 0;
446
        // create the maps in the page
447
        for (_i = 0; _i < olMapData.length; _i++) {
448
            var _id = olMapData[_i].mapOpts.id;
449
            olMaps[_id] = createMap(olMapData[_i].mapOpts, olMapData[_i].poi);
450
451
            // set max-width on help pop-over
452
            jQuery('#' + _id).parent().parent().find('.olMapHelp').css('max-width', olMapData[_i].mapOpts.width);
453
454
            // shrink the map width to fit inside page container
455
            var _w = jQuery('#' + _id + '-olContainer').parent().innerWidth();
456
            if (parseInt(olMapData[_i].mapOpts.width) > _w) {
457
                jQuery('#' + _id).width(_w);
458
                jQuery('#' + _id + '-olStatusBar').width(_w);
459
                jQuery('#' + _id).parent().parent().find('.olMapHelp').width(_w);
460
                olMaps[_id].updateSize();
461
            }
462
        }
463
464
        let resizeTimer;
465
        jQuery(window).on('resize', function (e) {

ol6/script.js 1 location

@@ 428-443 (lines=16) @@
425
426
        var _i = 0;
427
        // create the maps in the page
428
        for (_i = 0; _i < olMapData.length; _i++) {
429
            var _id = olMapData[_i].mapOpts.id;
430
            olMaps[_id] = createMap(olMapData[_i].mapOpts, olMapData[_i].poi);
431
432
            // set max-width on help pop-over
433
            jQuery('#' + _id).parent().parent().find('.olMapHelp').css('max-width', olMapData[_i].mapOpts.width);
434
435
            // shrink the map width to fit inside page container
436
            const _w = jQuery('#' + _id + '-olContainer').parent().innerWidth();
437
            if (parseInt(olMapData[_i].mapOpts.width) > _w) {
438
                jQuery('#' + _id).width(_w);
439
                jQuery('#' + _id + '-olStatusBar').width(_w);
440
                jQuery('#' + _id).parent().parent().find('.olMapHelp').width(_w);
441
                olMaps[_id].updateSize();
442
            }
443
        }
444
445
        var resizeTimer;
446
        jQuery(window).on('resize', function (e) {