Esri / storymap-shortlist

The Shortlist story map application template by Esri
http://storymaps.arcgis.com/en/app-list/shortlist/
Apache License 2.0
43 stars 61 forks source link

Desktop Resize - Need to Set Header Height Before Using it to Size the Content Panel #78

Open nheick opened 7 years ago

nheick commented 7 years ago

In MainView.resize, the header height is resized after it is used to calculate the variable heightAroundMap, not before. If you shrink the browser to a mobile size on your desktop and then maximize the browser, the header height is zero instead of 90 or 100, and the map and tile list extend below the bottom of the window by 90 or 100px.

Moving this block of code:

if (!_urlParams.embed && _urlParams.embed !== '' && !app.cfg.embed && !_urlParams.forceEmbed && !app.indexCfg.forceEmbed) { // CUSTOM LACSD CODE var headerHeight = app.data.getWebAppData().getHeader().compactSize ? '90px' : '100px'; $('#header').height(headerHeight); }

before this block of code:

var heightViewport = $("body").height(); var heightAroundMap = 0; $('.mainViewAboveMap, .mainViewBelowMap').each(function(i, item){ var itemObj = $(item); heightAroundMap += itemObj.is(':visible') ? itemObj.outerHeight() : 0; });

fixes the problem.