add support for horizontal resizing
This commit is contained in:
parent
228e167bbe
commit
cfd58e50aa
|
@ -3,6 +3,10 @@ var _infscroll_disable = 0;
|
||||||
var _infscroll_request_sent = 0;
|
var _infscroll_request_sent = 0;
|
||||||
var feed_under_pointer = undefined;
|
var feed_under_pointer = undefined;
|
||||||
|
|
||||||
|
var mouse_is_down = false;
|
||||||
|
var mouse_y = 0;
|
||||||
|
var mouse_x = 0;
|
||||||
|
|
||||||
var enable_resize = false;
|
var enable_resize = false;
|
||||||
|
|
||||||
function viewCategory(cat) {
|
function viewCategory(cat) {
|
||||||
|
@ -465,10 +469,6 @@ function init_collapsable_feedlist(theme) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var mouse_is_down = false;
|
|
||||||
var mouse_y = 0;
|
|
||||||
var mouse_x = 0;
|
|
||||||
|
|
||||||
function mouse_move_handler(e) {
|
function mouse_move_handler(e) {
|
||||||
try {
|
try {
|
||||||
var client_y;
|
var client_y;
|
||||||
|
|
44
tt-rss.js
44
tt-rss.js
|
@ -15,7 +15,8 @@ var sanity_check_done = false;
|
||||||
var _hfd_scrolltop = 0;
|
var _hfd_scrolltop = 0;
|
||||||
var hotkey_prefix = false;
|
var hotkey_prefix = false;
|
||||||
var init_params = new Object();
|
var init_params = new Object();
|
||||||
var ver_reflow_delta = 0;
|
var ver_offset = 0;
|
||||||
|
var hor_offset = 0;
|
||||||
|
|
||||||
function tagsAreDisplayed() {
|
function tagsAreDisplayed() {
|
||||||
return display_tags;
|
return display_tags;
|
||||||
|
@ -358,14 +359,7 @@ function init() {
|
||||||
|
|
||||||
function resize_headlines(delta_x, delta_y) {
|
function resize_headlines(delta_x, delta_y) {
|
||||||
|
|
||||||
ver_reflow_delta = delta_y;
|
debug("resize_headlines: " + hor_offset + ":" + ver_offset);
|
||||||
|
|
||||||
if (getInitParam("cookie_lifetime") != 0) {
|
|
||||||
setCookie("ttrss_reflow_ver", ver_reflow_delta,
|
|
||||||
getInitParam("cookie_lifetime"));
|
|
||||||
} else {
|
|
||||||
setCookie("ttrss_reflow_ver", ver_reflow_delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
var h_frame = document.getElementById("headlines-frame");
|
var h_frame = document.getElementById("headlines-frame");
|
||||||
var c_frame = document.getElementById("content-frame");
|
var c_frame = document.getElementById("content-frame");
|
||||||
|
@ -380,16 +374,29 @@ function resize_headlines(delta_x, delta_y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getInitParam("theme") == "3pane") {
|
if (getInitParam("theme") == "3pane") {
|
||||||
|
|
||||||
|
if (c_frame.offsetLeft > feeds_frame.offsetWidth + feeds_frame.offsetLeft + 100) {
|
||||||
|
hor_offset = delta_x;
|
||||||
|
}
|
||||||
|
|
||||||
debug("resize_headlines: HOR-mode");
|
debug("resize_headlines: HOR-mode");
|
||||||
|
|
||||||
c_frame.style.width = '35%';
|
c_frame.style.width = (400+hor_offset) + "px";
|
||||||
h_frame.style.right = c_frame.offsetWidth - 1 + "px";
|
h_frame.style.right = c_frame.offsetWidth - 1 + "px";
|
||||||
|
|
||||||
|
resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 60) + "px";
|
||||||
|
resize_grab.style.left = (h_frame.offsetLeft + h_frame.offsetWidth -
|
||||||
|
4) + "px";
|
||||||
|
resize_grab.style.display = "block";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
ver_offset = delta_y;
|
||||||
|
|
||||||
debug("resize_headlines: VER-mode");
|
debug("resize_headlines: VER-mode");
|
||||||
|
|
||||||
if (!is_msie()) {
|
if (!is_msie()) {
|
||||||
h_frame.style.height = (300 - ver_reflow_delta) + "px";
|
h_frame.style.height = (300 - ver_offset) + "px";
|
||||||
|
|
||||||
c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 1) + "px";
|
c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 1) + "px";
|
||||||
h_frame.style.height = h_frame.offsetHeight + "px";
|
h_frame.style.height = h_frame.offsetHeight + "px";
|
||||||
|
@ -420,6 +427,16 @@ function resize_headlines(delta_x, delta_y) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getInitParam("cookie_lifetime") != 0) {
|
||||||
|
setCookie("ttrss_offset_ver", ver_offset,
|
||||||
|
getInitParam("cookie_lifetime"));
|
||||||
|
setCookie("ttrss_offset_hor", hor_offset,
|
||||||
|
getInitParam("cookie_lifetime"));
|
||||||
|
} else {
|
||||||
|
setCookie("ttrss_offset_ver", ver_offset);
|
||||||
|
setCookie("ttrss_offset_hor", hor_offset);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_second_stage() {
|
function init_second_stage() {
|
||||||
|
@ -445,9 +462,10 @@ function init_second_stage() {
|
||||||
|
|
||||||
loading_set_progress(60);
|
loading_set_progress(60);
|
||||||
|
|
||||||
ver_reflow_delta = getCookie("ttrss_reflow_ver");
|
ver_offset = getCookie("ttrss_offset_ver");
|
||||||
|
|
||||||
if (!ver_reflow_delta) ver_reflow_delta = 0;
|
if (!ver_offset || ver_offset == undefined || ver_offset == 'undefined') ver_offset = 0;
|
||||||
|
if (!hor_offset || hor_offset == undefined || hor_offset == 'undefined') hor_offset = 0;
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("init_second_stage", e);
|
exception_error("init_second_stage", e);
|
||||||
|
|
Loading…
Reference in New Issue