mirror of
https://github.com/unraid/webgui.git
synced 2026-01-05 17:20:04 -06:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user