From f50258fa9967cb1f7ecde9693d7570262d8562f3 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 7 Jun 2007 10:46:36 +0000 Subject: [PATCH] http://issues.alfresco.com/browse/AWC-611 http://issues.alfresco.com/browse/AWC-1260 http://issues.alfresco.com/browse/AWC-1170 Improvement of alignment for pop-up panel - was rendering off the top of the screen if the preview text was very large vertically. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5877 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/web/bean/SearchContext.java | 1 + .../alfresco/web/ui/common/component/UIPanel.java | 4 ++-- source/web/WEB-INF/faces-config-beans.xml | 2 +- source/web/scripts/ajax/common.js | 14 +++++++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/web/bean/SearchContext.java b/source/java/org/alfresco/web/bean/SearchContext.java index b81b68d976..7003feb0b2 100644 --- a/source/java/org/alfresco/web/bean/SearchContext.java +++ b/source/java/org/alfresco/web/bean/SearchContext.java @@ -613,6 +613,7 @@ public final class SearchContext implements Serializable } else { + if (value.length() == 1) return; // handle just opcode prefix = STR_OP_WILDCARD; safeValue = QueryParser.escape(value.substring(1, value.length() - 1)); } diff --git a/source/java/org/alfresco/web/ui/common/component/UIPanel.java b/source/java/org/alfresco/web/ui/common/component/UIPanel.java index 403df85008..00845a974f 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIPanel.java +++ b/source/java/org/alfresco/web/ui/common/component/UIPanel.java @@ -168,11 +168,11 @@ public class UIPanel extends UICommand if (isExpanded() == true) { - out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, label)); + out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, getLabel())); } else { - out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, label)); + out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, getLabel())); } out.write("  "); diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 94f54b122d..07d853f8be 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -1078,7 +1078,7 @@ authenticationService - #{authenticationService} + #{AuthenticationService} permissionService diff --git a/source/web/scripts/ajax/common.js b/source/web/scripts/ajax/common.js index 2f385e88cb..30e285b349 100644 --- a/source/web/scripts/ajax/common.js +++ b/source/web/scripts/ajax/common.js @@ -345,6 +345,7 @@ function getContextPath() if (elWidth > maxwidth) elWidth = maxwidth; } var docWidth = this.getDocumentWidth(); + var shiftedLeft = false; if (pos.x + 20 + elWidth < docWidth) { el.style.left = (pos.x + 20) + "px"; @@ -353,6 +354,7 @@ function getContextPath() { // Shifting X coord left - overflow el.style.left = (pos.x + 20 - ((pos.x + elWidth) - docWidth)) + "px"; + shiftedLeft = true; } if (pos.y + 12 + elHeight < this.getDocumentHeight()) { @@ -361,7 +363,17 @@ function getContextPath() else { // Shifting Y coord up - overflow - el.style.top = (pos.y - elHeight + 4) + "px"; + if (shiftedLeft == true) + { + el.style.top = (pos.y - elHeight + 4) + "px"; + } + else + { + // we have room to shift vertically without overwriting the pop-up icon + var ypos = (pos.y - elHeight + 4); + if (ypos < 0) ypos = 0; + el.style.top = ypos + "px"; + } } } };