aboutsummaryrefslogtreecommitdiff
path: root/src/web.cc
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-10-20 00:09:51 +0200
committerjcid <devnull@localhost>2007-10-20 00:09:51 +0200
commit9ef21280a66c7d77761fd1e4e5deab02314e7e61 (patch)
tree06af21f1ecd964bf57510773bff5e064cab88871 /src/web.cc
parentccb2b7179eccf5b0e96475e277e716a46977e7f3 (diff)
Fixed the problem of scrolling position (remember position in a page)
Diffstat (limited to 'src/web.cc')
-rw-r--r--src/web.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/web.cc b/src/web.cc
index 1c70371d..74670c99 100644
--- a/src/web.cc
+++ b/src/web.cc
@@ -93,17 +93,17 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
/* This method frees the old dw if any */
layout->setWidget(dw);
- if (URL_POSX(Web->url) || URL_POSY(Web->url)) {
- layout->scrollTo(HPOS_LEFT, VPOS_TOP,
- URL_POSX(Web->url), URL_POSY(Web->url),
- 0, 0);
- } else {
- char *pf = a_Url_decode_hex_str(URL_FRAGMENT_(Web->url));
- if (pf) {
- layout->setAnchor(pf);
- dFree(pf);
- }
- }
+ /* Scroll to were we were in this page */
+ layout->scrollTo(HPOS_LEFT, VPOS_TOP,
+ URL_POSX(Web->url), URL_POSY(Web->url), 0, 0);
+ /* If we're at the origin and there's a fragment, go there instead */
+ if (URL_POSX(Web->url) == 0 && URL_POSY(Web->url) == 0) {
+ char *f = a_Url_decode_hex_str(URL_FRAGMENT_(Web->url));
+ if (f) {
+ layout->setAnchor(f);
+ dFree(f);
+ }
+ }
/* Clear the title bar for pages without a <TITLE> tag */
a_UIcmd_set_page_title(Web->bw, "");