]> git.wh0rd.org Git - tt-rss.git/commitdiff
add action to reset UI layout, resize_headlines parameter checking
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 20 May 2008 03:43:21 +0000 (04:43 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 20 May 2008 03:43:21 +0000 (04:43 +0100)
tt-rss.js
tt-rss.php

index dcfcb87ab0e8a058b259a2f8bd46917ab0ffd4cd..61598a99b0048f6d443d7e952fe3be2f2f6fc023 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -376,12 +376,14 @@ function resize_headlines(delta_x, delta_y) {
        if (getInitParam("theme") == "3pane") {
 
                if (c_frame.offsetLeft > feeds_frame.offsetWidth + feeds_frame.offsetLeft + 100) {
-                       hor_offset = delta_x;
+                       if (delta_x != undefined) {
+                               hor_offset = delta_x;
+                       }
                }
 
                debug("resize_headlines: HOR-mode");
 
-               c_frame.style.width = (400+hor_offset) + "px";
+               c_frame.style.width = (400 + hor_offset) + "px";
                h_frame.style.right = c_frame.offsetWidth - 1 + "px";
 
                resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 60) + "px";
@@ -391,7 +393,9 @@ function resize_headlines(delta_x, delta_y) {
 
        } else {
 
-               ver_offset = delta_y;
+               if (delta_y != undefined) {
+                       ver_offset = delta_y;
+               }
 
                debug("resize_headlines: VER-mode");
 
@@ -578,6 +582,12 @@ function quickMenuGo(opid) {
                        Effect.Appear("hotkey_help_overlay", {duration : 0.3});
                }
 
+               if (opid == "qmcResetUI") {
+                       hor_offset = 0;
+                       ver_offset = 0;
+                       resize_headlines();
+               }
+
        } catch (e) {
                exception_error("quickMenuGo", e);
        }
index e749d43f3228b8a5a068989bb1d6aed6f4b11bae..e0a5d0862653f0de6a1e61cd931e74ada95d0f02 100644 (file)
@@ -165,6 +165,8 @@ window.onload = init;
                                        <option disabled>--------</option>
                                        <option style="color : #5050aa" disabled><?php echo __('Other actions:') ?></option>                            
                                        <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
+                                       <option value="qmcResetUI"><?php echo __('&nbsp;&nbsp;Reset UI layout') ?></option>
+
                                        <option value="qmcHKhelp"><?php echo __('&nbsp;&nbsp;Keyboard shortcuts') ?></option>
                        </select>
                </div>