mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-22 09:41:29 +00:00
persist widescreen mode in session
This commit is contained in:
@@ -637,5 +637,13 @@ class RPC extends Handler_Protected {
|
|||||||
"score_pic" => theme_image($link, get_score_pic($score))));
|
"score_pic" => theme_image($link, get_score_pic($score))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setpanelmode() {
|
||||||
|
$wide = (int) $_REQUEST["wide"];
|
||||||
|
|
||||||
|
$_SESSION["widescreen"] = $wide;
|
||||||
|
|
||||||
|
print json_encode(array("wide" => $wide));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1966,6 +1966,7 @@
|
|||||||
$params["hotkeys"] = get_hotkeys_map($link);
|
$params["hotkeys"] = get_hotkeys_map($link);
|
||||||
|
|
||||||
$params["csrf_token"] = $_SESSION["csrf_token"];
|
$params["csrf_token"] = $_SESSION["csrf_token"];
|
||||||
|
$params["widescreen"] = (int) $_SESSION["widescreen"];
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|||||||
13
js/tt-rss.js
13
js/tt-rss.js
@@ -336,6 +336,12 @@ function init_second_stage() {
|
|||||||
updateFeedList();
|
updateFeedList();
|
||||||
closeArticlePanel();
|
closeArticlePanel();
|
||||||
|
|
||||||
|
_widescreen_mode = getInitParam("widescreen");
|
||||||
|
|
||||||
|
if (_widescreen_mode) {
|
||||||
|
switchPanelMode(_widescreen_mode);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof themeAfterLayout == 'function') {
|
if (typeof themeAfterLayout == 'function') {
|
||||||
themeAfterLayout();
|
themeAfterLayout();
|
||||||
}
|
}
|
||||||
@@ -1007,6 +1013,13 @@ function switchPanelMode(wide) {
|
|||||||
|
|
||||||
if (article_id) view(article_id);
|
if (article_id) view(article_id);
|
||||||
|
|
||||||
|
new Ajax.Request("backend.php", {
|
||||||
|
parameters: "op=rpc&method=setpanelmode&wide=" + (wide ? 1 : 0),
|
||||||
|
onComplete: function(transport) {
|
||||||
|
console.log(transport.responseText);
|
||||||
|
} });
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("switchPanelMode", e);
|
exception_error("switchPanelMode", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user