Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GoFish doesn't scroll to matching line
Message
From
30/01/2023 06:58:09
 
 
To
29/01/2023 06:52:57
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
VFPX/Sedna
Miscellaneous
Thread ID:
01685788
Message ID:
01686006
Views:
41
Likes (1)
>>>>>>>>I think this code was assumed to be "good enough," but that there are cases where it fails.
>>>>>>>>
>>>>>>>>Tamar
>>>>>>>
>>>>>>>Maybe one should place an anchor and force the browser to jump to the anchor? Anyone using JS? Let's see if we can borrow wisdom ...
>>>>>>
>>>>>>Well, I can repeat my suggestion, whereby
>>>>>>
>>>>>>
	function ScrollToMatch(){
>>>>>>		var MatchDiv = document.getElementById('matchline');
>>>>>>		MatchDiv.scrollIntoView();
>>>>>>	}
>>>>>>
>>>>>>
>>>>>>Though in my case it scrolls the div element in which the piece resides, but I think I've seen it work with the whole page.
>>>>>
>>>>>Lutz:
>>>>>
>>>>>I spent some time on this this afternoon. The file that needs to be changed is GoFish5\HTML\GoFish.js and the change is as easy as Dragan said. When I make the corresponding change to a file that I've saved using View Source, it scrolls properly. However, I haven't cracked how to get GoFish to use the new version of file. Tried compiling a new, differently-named, EXE and running that instead and it didn't do the trick. But by now, you know how to get GoFish to compile changes properly, so I'm kicking this back to you.
>>>>>
>>>>>BTW, I'm pretty sure this change means we could also remove the FindPos method from the same file, since we don't need it anymore.
>>>>>
>>>>>Tamar
>>>>
>>>>You can
>>>>- post the file in the JS just here
>>>>- in the old issue in guthub
>>>>- or mail it to me.
>>>>
>>>>I will work it into the app Friday and publish
>>>
>>>Just emailed it to you.
>>>
>>
>>Or not. It bounced. I'll try adding it here, zipped up.
>>
>>Tamar
>Hi Tamar
>
>Does not work with me.
>
>The example fails with a type conflict. Looking it up
> MatchDiv.scrollIntoView({block:"center"});
>fails.
>https://www.w3schools.com/jsref/met_element_scrollintoview.asp says parameter is just bool., so {block:"center"} is the culprit.
>
>It works with the boolean, but this is not the goal
>:(
>
>Lutz
>
>scrollIntoView can just top or bottom according to this page.

Here's where I got the parameters and this parameter works perfectly for me when I view the modified HTML file:

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

It occurs to me that we're using the WebBrowser control and it may not support this parameter, since it's old. The page I linked there links to this one:

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded

I wonder if that would work in the WebBrowser control. The compatibility charts don't include IE and the notes say this one is non-standard, but if it works in the control, who cares?

Tamar

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform