What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Cursor position when opening system log

john9527

Part of the Furniture
A nit problem, but annoying......when opening the System Log - General Log, it opens with the view at the end of the file. But if you try and scroll up or right, it immediately jumps to the top of the file instead of just doing the scroll. Appreciate it if you could put a fix for this on your todo list :)
 
Last edited:
A nit problem, but annoying......when opening the System Log - General Log, it opens with the view at the end of the file. But if you try and scroll up or right, it immediately jumps to the top of the file instead of just doing the scroll. Appreciate it if you could put a fix for this on your todo list :)

Blame your browser - it doesn't do that for me with Chrome. :)
 
Browser is IE10....which I would guess is used by more than a few people.....

Anyway....I took a peek at the code (asuswrt-merlin / release / src / router / www / Main_LogStatus_Content.asp).....I don't think the way it's positioned to a non-existent line number is a good way to do it and probably the problem.

document.getElementById('textarea').scrollTop = 9999999;//make Scroll_y bottom

maybe using

document.scrollIntoView(false);

would be better?
 
Browser is IE10....which I would guess is used by more than a few people.....

Anyway....I took a peek at the code (asuswrt-merlin / release / src / router / www / Main_LogStatus_Content.asp).....I don't think the way it's positioned to a non-existent line number is a good way to do it and probably the problem.

document.getElementById('textarea').scrollTop = 9999999;//make Scroll_y bottom

maybe using

document.scrollIntoView(false);

would be better?

I would have to see how it's implemented. It was done by Asus, so I never looked at it.
 
I don't know how/if you accept suggested updates....but here is a tested solution for the scroll problem under IE.

diff --git a/release/src/router/www/Main_LogStatus_Content.asp b/release/src/router/www/Main_LogStatus_Content.asp
index 4905ed7..96859a4 100644
--- a/release/src/router/www/Main_LogStatus_Content.asp
+++ b/release/src/router/www/Main_LogStatus_Content.asp
@@ -72,7 +72,8 @@ function initial(){
showclock();
showbootTime();
showDST();
- document.getElementById('textarea').scrollTop = 9999999;//make Scroll_y bottom
+ var retArea = document.getElementById('textarea');
+ retArea.scrollTop = retArea.scrollHeight - retArea.clientHeight; //Fix positioning for IE
 
Never had this problem with IE11 or Firefox.

What happens if you view the log with addons disabled?
 
Next time I need to load firmware...I'll load stock first and give it a try without addons (I currently have my own build with this fix loaded).

But....apparently it's a pretty common problem. While I'd like to take credit for figuring this out, I found the exact problem/solution on 'Stack Overflow'.
 
I don't know how/if you accept suggested updates....but here is a tested solution for the scroll problem under IE.

diff --git a/release/src/router/www/Main_LogStatus_Content.asp b/release/src/router/www/Main_LogStatus_Content.asp
index 4905ed7..96859a4 100644
--- a/release/src/router/www/Main_LogStatus_Content.asp
+++ b/release/src/router/www/Main_LogStatus_Content.asp
@@ -72,7 +72,8 @@ function initial(){
showclock();
showbootTime();
showDST();
- document.getElementById('textarea').scrollTop = 9999999;//make Scroll_y bottom
+ var retArea = document.getElementById('textarea');
+ retArea.scrollTop = retArea.scrollHeight - retArea.clientHeight; //Fix positioning for IE

I agree that the current method is quite hackish. Not sure why Asus went with that - maybe because the cleaner method as you suggested wouldn't work on some browsers. This will require additional validation on different browsers.
 
According to the doc I saw, should be good except possibly on some versions of Opera.

Anyway, not a big deal since I'm now set up to compile my own builds and can do my own merge if necessary.
 
I don't know how/if you accept suggested updates....but here is a tested solution for the scroll problem under IE.

diff --git a/release/src/router/www/Main_LogStatus_Content.asp b/release/src/router/www/Main_LogStatus_Content.asp
index 4905ed7..96859a4 100644
--- a/release/src/router/www/Main_LogStatus_Content.asp
+++ b/release/src/router/www/Main_LogStatus_Content.asp
@@ -72,7 +72,8 @@ function initial(){
showclock();
showbootTime();
showDST();
- document.getElementById('textarea').scrollTop = 9999999;//make Scroll_y bottom
+ var retArea = document.getElementById('textarea');
+ retArea.scrollTop = retArea.scrollHeight - retArea.clientHeight; //Fix positioning for IE

I tested it with both Chrome and Firefox and it was working fine, so I went ahead and applied this patch. Thanks!
 
...

Anyway, not a big deal since I'm now set up to compile my own builds and can do my own merge if necessary.

But please do share your knowledge to fix an issue. (As you did above.)
Makes it a better router for everyone. :)

Thx!
 
Similar threads

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top