Keep empty region previews blank
This commit is contained in:
1 parent
1e317997c4
commit
a4936b6a20
13 files changed
+22
-15
No files matched your search
@@ -69,6 +69,8 @@ function substituteWeatherVariables(html, value) {
|
||||
}
|
||||
|
||||
function renderWeatherRegion(region, regionContent) {
|
||||
var value = String(regionContent && regionContent.value || '');
|
||||
if (!value.trim()) return '';
|
||||
var location = getWeatherLocation(regionContent && regionContent.weather_location_id);
|
||||
var snapshot = location && location.responseJson && typeof location.responseJson === 'object' ? location.responseJson : null;
|
||||
var width = Math.max(1, Math.round(Number(region && region.pixelWidth) || 1));
|
||||
@@ -77,7 +79,6 @@ function renderWeatherRegion(region, regionContent) {
|
||||
var style = 'width:' + width + 'px;height:' + height + 'px;transform:scale(' + scale + ');transform-origin:top left;overflow:hidden;';
|
||||
if (!location || !snapshot) return '<div class="template-region weather" style="' + region.baseStyle + '"><div style="' + style + '"></div></div>';
|
||||
var current = snapshot.current || {};
|
||||
var value = String(regionContent && regionContent.value || '');
|
||||
if (value) {
|
||||
var weatherData = withWeatherUnits(snapshot, location);
|
||||
var fontSize = Math.max(8, Number(regionContent && regionContent.font_size || region && (region.font_size || region.fontSize) || 32) || 32);
|
||||
|
||||
Reference in new issue
Block a user