| Summary: | [editor] Editor steals scrolling from containing page | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Andrew Niefer <aniefer> |
| Component: | Client | Assignee: | Felipe Heidrich <eclipse.felipe> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, john.arthorne |
| Version: | 0.2 | ||
| Target Milestone: | 0.2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Andrew Niefer
Looking at your blog in FF 3.6, all the snippets have vertical scrollbars... Maybe the editor needs an option to disable scrollbars. What browser/platform are you using ? John, it is possible to disable the scrollbar for the editor, it is a CSS attribute. Andrew, is that something that you would like to do (I can go find the correct attribute name and value for you) ? Personally I find it would look nicer if: - the height was set to lineCount*lineHeight (no scrollbars, no waste white space at bottom) - a nice border around the editor, set it on the parent div. I don't mind having the scroll bars when the editor contains more content. The trick here is that I'm not sure how to determine the lineheight. If I can find the lineheight using javascript, then what I could do is set the div height to some number in the html, and then in javascript when I create the editor adjust the height according to the length of the text. btw, I'm looking at the post on windows xp with firefox 3.6.13. I was also using firefox 3.6.12 on SLES and Chrome 6.0.472.63 on SLES when I wrote it. Not sure I follow the whole picture but I hope this can help: http://orion.eclipse.org/jsdoc/symbols/eclipse.Editor.html#getLineHeight Thanks Felipe, here is what I'm using to set the height: div.style.height = (editor.getLineHeight() * (editor.getModel().getLineCount() + 1)) + 2 + 'px'; Before adding the +1 to the linecount, I found I had to add the + 2 to make the vertical scroll bar not appear, there must be a border. I added the +1 to the lineCount to make room for a horizontal scrollbar. As for scrolling the page with the mouse wheel, none of my editors have vertical scrollbars, and firefox 3.6.13 on windows doesn't scroll past the editor. However, IE 8 is scrolling past the editor just fine. (In reply to comment #6) > Thanks Felipe, here is what I'm using to set the height: > div.style.height = (editor.getLineHeight() * (editor.getModel().getLineCount() > + 1)) + 2 + 'px'; > Before adding the +1 to the linecount, I found I had to add the + 2 to make the > vertical scroll bar not appear, there must be a border. I added the +1 to the > lineCount to make room for a horizontal scrollbar. I knew you would need some "extra" space in there. lineCount*lineHeight gives the size for the client area. You would need something of "computeTrim" to compute the bounding box size (add the space for the scrollbars, borders, etc). I will take a look in what can be done here to help the app to solve this prolem. The problem with your approach is that it assumes that height of hscrollbar is lineHeight, that can fail (changing the font size for example would break the code). > As for scrolling the page with the mouse wheel, none of my editors have > vertical scrollbars, and firefox 3.6.13 on windows doesn't scroll past the > editor. However, IE 8 is scrolling past the editor just fine. That is a bug, I'll take a look at it. fixed Thanks Felipe, I updated with your changes and scrolling works great for me now. |