mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-18 18:35:14 +08:00
WebUI: Use relative sizes when saving panel height
This should prevent situations in which the properties panel completely covers the transferlist on page load. Save also the height whenever the window is resized since that changes the height of the panels without saving the height.
This commit is contained in:
parent
95bf2ffc51
commit
16dcf39823
@ -49,11 +49,16 @@ window.addEvent('load', function () {
|
||||
|
||||
var saveColumnSizes = function () {
|
||||
var filters_width = $('Filters').getSize().x;
|
||||
var properties_height = $('propertiesPanel').getSize().y;
|
||||
var properties_height_rel = $('propertiesPanel').getSize().y / Window.getSize().y;
|
||||
localStorage.setItem('filters_width', filters_width);
|
||||
localStorage.setItem('properties_height', properties_height);
|
||||
localStorage.setItem('properties_height_rel', properties_height_rel);
|
||||
}
|
||||
|
||||
window.addEvent('resize', function() {
|
||||
// Resizing might takes some time.
|
||||
saveColumnSizes.delay(200);
|
||||
});
|
||||
|
||||
/*MochaUI.Desktop = new MochaUI.Desktop();
|
||||
MochaUI.Desktop.desktop.setStyles({
|
||||
'background': '#fff',
|
||||
@ -310,9 +315,9 @@ window.addEvent('load', function () {
|
||||
onResize : saveColumnSizes,
|
||||
height : null
|
||||
});
|
||||
var prop_h = localStorage.getItem('properties_height');
|
||||
var prop_h = localStorage.getItem('properties_height_rel');
|
||||
if ($defined(prop_h))
|
||||
prop_h = prop_h.toInt();
|
||||
prop_h = prop_h.toFloat() * Window.getSize().y;
|
||||
else
|
||||
prop_h = Window.getSize().y / 2.;
|
||||
new MochaUI.Panel({
|
||||
|
Loading…
Reference in New Issue
Block a user