add vertical resize grip

master
Andrew Dolgov 17 years ago
parent 08827aafd7
commit f3169d7ecc

@ -328,6 +328,9 @@ function feedlist_init() {
hideOrShowFeeds(document, getInitParam("hide_read_feeds") == 1);
document.onkeydown = hotkey_handler;
document.onmousemove = mouse_move_handler;
document.onmousedown = mouse_down_handler;
document.onmouseup = mouse_up_handler;
setTimeout("timeout()", 0);
/* debug("about to remove splash, OMG!");
@ -460,4 +463,49 @@ function init_collapsable_feedlist(theme) {
}
var mouse_is_down = false;
var mouse_y = 0;
function mouse_move_handler(e) {
try {
var client_y;
if (window.event) {
client_y = window.event.clientY;
} else if (e) {
}
if (mouse_is_down) {
if (mouse_y == 0) mouse_y = client_y;
debug("moved delta: " + (mouse_y - client_y));
resize_headlines(0, mouse_y - client_y);
return false;
}
} catch (e) {
exception_error("mouse_move_handler", e);
}
}
function mouse_down_handler(e) {
try {
mouse_is_down = true;
} catch (e) {
exception_error("mouse_move_handler", e);
}
}
function mouse_up_handler(e) {
try {
mouse_is_down = false;
} catch (e) {
exception_error("mouse_move_handler", e);
}
}

@ -1490,6 +1490,21 @@ div.headlines_cdm {
/* height: expression((parseInt(document.documentElement.clientHeight)-40-305-50)+'px'); */
}
#resize-grabber {
position : absolute;
border-width : 1px;
border-style : dotted;
border-color : #88b0f0;
background-color : white;
width : 10px;
height : 10px;
z-index : 20;
right : 10px;
top : 20px;
display : none;
cursor : move;
}
#footer, #prefFooter {
position : absolute;
bottom : 0px;

@ -16,6 +16,7 @@ var sanity_check_done = false;
var _hfd_scrolltop = 0;
var hotkey_prefix = false;
var init_params = new Object();
var ver_reflow_delta = 0;
function tagsAreDisplayed() {
return display_tags;
@ -356,12 +357,15 @@ function init() {
}
}
function resize_headlines() {
function resize_headlines(delta_x, delta_y) {
ver_reflow_delta = delta_y;
var h_frame = document.getElementById("headlines-frame");
var c_frame = document.getElementById("content-frame");
var f_frame = document.getElementById("footer");
var feeds_frame = document.getElementById("feeds-holder");
var resize_grab = document.getElementById("resize-grabber");
if (!c_frame || !h_frame) return;
@ -379,9 +383,14 @@ function resize_headlines() {
debug("resize_headlines: VER-mode");
if (!is_msie()) {
h_frame.style.height = 30 + "%";
c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px";
h_frame.style.height = (300 - ver_reflow_delta) + "px";
c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 1) + "px";
h_frame.style.height = h_frame.offsetHeight + "px";
resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 5) + "px";
resize_grab.style.display = "block";
} else {
h_frame.style.height = document.documentElement.clientHeight * 0.3 + "px";
c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px";
@ -395,7 +404,7 @@ function resize_headlines() {
c_frame.style.height = c_bottom - (h_frame.offsetTop +
h_frame.offsetHeight + 1) + "px";
h_frame.style.height = h_frame.offsetHeight + "px";
}
}

@ -239,6 +239,7 @@ window.onload = init;
<div id="headlines-frame" class="headlines_normal">
<div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
<div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
<div id="resize-grabber" title="<?php echo __('Drag me to resize panels') ?>"> </div>
<?php } else { ?>
<div id="headlines-frame" class="headlines_cdm">
<div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>

Loading…
Cancel
Save