1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Store user zoom level in localStorage

This commit is contained in:
Nick O'Leary 2022-01-17 21:27:48 +00:00
parent 085233ab9b
commit 5fc920087b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -678,6 +678,11 @@ RED.view = (function() {
show: function(n) { return !n.valid }
})
var userZoomLevel = parseFloat(RED.settings.getLocal('zoom-level'))
if (!isNaN(userZoomLevel)) {
scaleFactor = userZoomLevel
}
}
@ -1965,6 +1970,7 @@ RED.view = (function() {
}
function zoomZero() { zoomView(1); }
function zoomView(factor) {
var screenSize = [chart.width(),chart.height()];
var scrollPos = [chart.scrollLeft(),chart.scrollTop()];
@ -1977,6 +1983,7 @@ RED.view = (function() {
RED.view.navigator.resize();
redraw();
RED.settings.setLocal('zoom-level', factor.toFixed(1))
}
function selectNone() {