From d43d6f7dffef14eb026799e1ccb805b758628a80 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Jun 2023 08:31:10 +0300 Subject: [PATCH] keep two sets of content-insert size cookies for wide & normal mode --- js/App.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/js/App.js b/js/App.js index dad7723ca..963a032c5 100644 --- a/js/App.js +++ b/js/App.js @@ -810,8 +810,10 @@ const App = { dojo.connect(dijit.byId('content-insert'), 'resize', (args) => { if (args && args.w >= 0 && args.h >= 0) { - Cookie.set("ttrss_ci_width", args.w, this.getInitParam("cookie_lifetime")); - Cookie.set("ttrss_ci_height", args.h, this.getInitParam("cookie_lifetime")); + const cookie_suffix = this._widescreen_mode ? "wide" : "normal"; + + Cookie.set("ttrss_ci_width:" + cookie_suffix, args.w, this.getInitParam("cookie_lifetime")); + Cookie.set("ttrss_ci_height:" + cookie_suffix, args.h, this.getInitParam("cookie_lifetime")); } }); @@ -918,10 +920,6 @@ const App = { return; } - // reset stored sizes because geometry changed - Cookie.set("ttrss_ci_width", 0); - Cookie.set("ttrss_ci_height", 0); - this._widescreen_mode = wide; const article_id = Article.getActive(); @@ -938,9 +936,9 @@ const App = { height: 'auto', borderTopWidth: '0px' }); - if (parseInt(Cookie.get("ttrss_ci_width")) > 0) { + if (parseInt(Cookie.get("ttrss_ci_width:wide")) > 0) { content_insert.domNode.setStyle( - {width: Cookie.get("ttrss_ci_width") + "px" }); + {width: Cookie.get("ttrss_ci_width:wide") + "px" }); } headlines_frame.setStyle({ borderBottomWidth: '0px' }); @@ -953,9 +951,9 @@ const App = { height: '50%', borderTopWidth: '0px'}); - if (parseInt(Cookie.get("ttrss_ci_height")) > 0) { + if (parseInt(Cookie.get("ttrss_ci_height:normal")) > 0) { content_insert.domNode.setStyle( - {height: Cookie.get("ttrss_ci_height") + "px" }); + {height: Cookie.get("ttrss_ci_height:normal") + "px" }); } headlines_frame.setStyle({ borderBottomWidth: '1px' });