Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-12-08 19:14:09 +0000
committerChris Goldthorpe2009-12-08 19:14:09 +0000
commit446c34d8f57ccf5b653a2a6052e61d4aba76b279 (patch)
treec3db03510538abcc4d9f7f5ebe27e88c6559a872
parentf9b873c922a92c5ac813dfa8956592209b60702c (diff)
downloadeclipse.platform.ua-446c34d8f57ccf5b653a2a6052e61d4aba76b279.tar.gz
eclipse.platform.ua-446c34d8f57ccf5b653a2a6052e61d4aba76b279.tar.xz
eclipse.platform.ua-446c34d8f57ccf5b653a2a6052e61d4aba76b279.zip
Bug 223975 – [Webapp] Appearance problems in TOC view in RTL mode
-rw-r--r--org.eclipse.help.webapp/advanced/tocView.jsp1
-rw-r--r--org.eclipse.help.webapp/advanced/utils.js15
2 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.help.webapp/advanced/tocView.jsp b/org.eclipse.help.webapp/advanced/tocView.jsp
index 0b1994d24..ce9a9f956 100644
--- a/org.eclipse.help.webapp/advanced/tocView.jsp
+++ b/org.eclipse.help.webapp/advanced/tocView.jsp
@@ -62,6 +62,7 @@ var loadingMessage = "<%=UrlUtil.JavaScriptEncode(ServletResources.getString("Lo
var cookiesRequired = "<%=UrlUtil.JavaScriptEncode(ServletResources.getString("cookiesRequired", request))%>";
var isIE = navigator.userAgent.indexOf('MSIE') != -1;
+var isRTL = <%=isRTL%>;
var tocTitle = "";
var tocId = "";
diff --git a/org.eclipse.help.webapp/advanced/utils.js b/org.eclipse.help.webapp/advanced/utils.js
index 401a923a8..664d616c1 100644
--- a/org.eclipse.help.webapp/advanced/utils.js
+++ b/org.eclipse.help.webapp/advanced/utils.js
@@ -82,8 +82,19 @@ function scrollUntilVisible(node, flags)
}
}
- if (flags & SCROLL_HORIZONTAL && isScrollLeft) {
- if (nodeLeft < pageLeft) {
+ if ((flags & SCROLL_HORIZONTAL ) && isRTL) {
+ // In RTL mode aligning the right edge is more important than aligning the left
+ if (nodeRight > pageRight && isScrollRight) {
+ hScroll = nodeRight - pageRight;
+ } else {
+ if (nodeLeft < pageLeft && isScrollLeft) {
+ hScroll = Math.max(nodeLeft - pageLeft, nodeRight - pageRight);
+ } else {
+ hScroll = 0; // already in view
+ }
+ }
+ } else if (flags & SCROLL_HORIZONTAL ) {
+ if (nodeLeft < pageLeft && isScrollLeft) {
hScroll = nodeLeft - pageLeft;
} else {
if (nodeRight > pageRight && isScrollRight) {

Back to the top