refactor: update PageMap.page for dynamic height adjustment

- Replaced the existing resize function with fillAvailableHeight for better dynamic resizing of elements.
- Wrapped the map display in a new div with class 'js-fill-available-height' for improved structure.
- Ensured the 'Done' button is now within a separate 'js-actions' div for clearer layout.
This commit is contained in:
Zack Spear
2025-06-26 14:35:27 -07:00
parent adb30a1214
commit 65360afc9d

View File

@@ -17,12 +17,18 @@ Tag="map-o"
?>
<?if (_var($display,'resize')):?>
<script>
function resize() {
$('div.up').height(Math.max(window.innerHeight-320,330));
}
const fillAvailableHeightParams = {
targetElementSelector: '.js-fill-available-height',
elementSelectorsForHeight: [
'.title',
'.js-actions',
],
};
$(function() {
resize();
$(window).bind('resize',function(){resize();});
fillAvailableHeight(fillAvailableHeightParams);
$(window).bind('resize', function() {
fillAvailableHeight(fillAvailableHeightParams);
});
});
</script>
<?endif;?>
@@ -57,10 +63,15 @@ foreach($uri as $more) {
$language = array_merge($language,unserialize(file_get_contents($store)));
}
}
echo "<div class='up'>";
show_map("Tasks", 1);
show_map("Buttons", 1);
echo "</div>";
?>
<input type="button" value="_(Done)_" onclick="done()">
<div class="js-fill-available-height up">
<?
show_map("Tasks", 1);
show_map("Buttons", 1);
?>
</div>
<div class="js-actions">
<input type="button" value="_(Done)_" onclick="done()">
</div>