Skip to content

Commit 4a1e656

Browse files
committed
fix: scroll to bottom
1 parent 875ab44 commit 4a1e656

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

dev.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.bottom-panel{
2-
max-width: 680px;
1+
.bottom-panel {
2+
max-width: 680px;
33
}

src/GEOComp.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,14 @@ var GEOComp = (function () {
237237
props.feature.onChange(eventObj)
238238
break;
239239
case 'window:resize':
240-
if (featureEnabled('scaleToBottom') && props.autoHeight) {
241-
var bottom = (parseFloat(eventObj.element.style.paddingBottom.replace("px", "")) * 2) - 2
240+
if (true || (featureEnabled('scaleToBottom') && props.autoHeight)) {
241+
const pads = props.styles.padding.split(' ');
242+
const bottom = (parseFloat(pads[pads.length == 4 ? 3 : 0].replace("px", "")) * 2) - 2
242243
var newHeight = dimensions.height + (eventObj.windowSize.height - eventObj.bounds.bottom - bottom)
243244
eventObj.element.style.height = `${newHeight}px`
244245
setDimensions({ width: dimensions.width, height: newHeight })
246+
if (featureEnabled("debug"))
247+
console.debug("Resized done", newHeight)
245248
}
246249
break
247250
default:
@@ -493,6 +496,21 @@ GEOComp = withMethodExposing(GEOComp, [
493496
return clearFeatures(map, params[0])
494497
}
495498
},
499+
{
500+
method: {
501+
name: "configure",
502+
description: "Configure the plugin by json",
503+
params: [
504+
{
505+
name: "json",
506+
type: "JSONValue",
507+
}
508+
]
509+
},
510+
execute: async (comp: any, params: any) => {
511+
console.log("Configure", comp)
512+
}
513+
},
496514
]);
497515

498516

src/vendors/Geo.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,10 @@ function Geo(props) {
663663
var windowSize = useScreenSize()
664664
useEffect(() => {
665665
var el = document.getElementById('GEO.' + geoId)
666-
if (el)
666+
if (el) {
667+
console.log("Resize")
667668
fireEvent('window:resize', { element: el, windowSize: windowSize, bounds: el.getBoundingClientRect() })
669+
}
668670
}, [elementRef, windowSize])
669671

670672

0 commit comments

Comments
 (0)