You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2013/06/26 10:14:14 UTC

git commit: WICKET-5130 removed fix for select z-index bug in IE < 7

Updated Branches:
  refs/heads/master 8c21ccf8c -> 835223065


WICKET-5130 removed fix for select z-index bug in IE < 7

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/83522306
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/83522306
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/83522306

Branch: refs/heads/master
Commit: 8352230656fedb01c5a3569f684ebfd4d72c37bd
Parents: 8c21ccf
Author: svenmeier <sv...@meiers.net>
Authored: Wed Jun 26 10:13:05 2013 +0200
Committer: svenmeier <sv...@meiers.net>
Committed: Wed Jun 26 10:13:05 2013 +0200

----------------------------------------------------------------------
 .../AbstractAutoCompleteBehavior.java           |  4 +-
 .../html/autocomplete/AutoCompleteSettings.java | 40 +++------------
 .../html/autocomplete/wicket-autocomplete.js    | 53 +-------------------
 3 files changed, 9 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/83522306/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
index 9105f73..a9360a7 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteBehavior.java
@@ -150,9 +150,9 @@ public abstract class AbstractAutoCompleteBehavior extends AbstractDefaultAjaxBe
 		sb.append(",maxHeight: ").append(settings.getMaxHeightInPx());
 		sb.append(",adjustInputWidth: ").append(settings.isAdjustInputWidth());
 		sb.append(",useSmartPositioning: ").append(settings.getUseSmartPositioning());
-		sb.append(",useHideShowCoveredIEFix: ").append(settings.getUseHideShowCoveredIEFix());
 		sb.append(",showListOnEmptyInput: ").append(settings.getShowListOnEmptyInput());
-		sb.append(",ignoreBordersWhenPositioning: ").append(settings.getIgnoreBordersWhenPositioning());
+		sb.append(",ignoreBordersWhenPositioning: ").append(
+			settings.getIgnoreBordersWhenPositioning());
 		sb.append(",showListOnFocusGain: ").append(settings.getShowListOnFocusGain());
 		sb.append(",throttleDelay: ").append(settings.getThrottleDelay());
 		sb.append(",parameterName: '").append(settings.getParameterName()).append('\'');

http://git-wip-us.apache.org/repos/asf/wicket/blob/83522306/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java
index 8f784ad..0bd6aa8 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java
@@ -59,8 +59,6 @@ public final class AutoCompleteSettings implements IClusterable
 
 	private boolean ignoreBordersWhenPositioning = true;
 
-	private boolean useHideShowCoveredIEFix = true;
-
 	private String cssClassName = null;
 
 	private boolean adjustInputWidth = true;
@@ -160,7 +158,7 @@ public final class AutoCompleteSettings implements IClusterable
 	/**
 	 * Indicates whether the popup positioning will take into account the borders of the input
 	 * element and its ancestors.
-	 *
+	 * 
 	 * @return true if borders are ignored, false otherwise.
 	 */
 	public boolean getIgnoreBordersWhenPositioning()
@@ -172,12 +170,13 @@ public final class AutoCompleteSettings implements IClusterable
 	 * Sets whether the popup positioning will take into account the borders of the input element
 	 * and its ancestors (by including the <code>clientLeft</code> and <code>clientTop</code> DOM
 	 * properties in the computation).
-	 *
+	 * 
 	 * @param ignoreBordersWhenPositioning
 	 *            the flag
 	 * @return this {@link AutoCompleteSettings}.
 	 */
-	public AutoCompleteSettings setIgnoreBordersWhenPositioning(final boolean ignoreBordersWhenPositioning)
+	public AutoCompleteSettings setIgnoreBordersWhenPositioning(
+		final boolean ignoreBordersWhenPositioning)
 	{
 		this.ignoreBordersWhenPositioning = ignoreBordersWhenPositioning;
 		return this;
@@ -195,18 +194,6 @@ public final class AutoCompleteSettings implements IClusterable
 	}
 
 	/**
-	 * Indicates whether in case of IE (and Opera), "select" "iframe" and "applet" tags should be
-	 * hidden if covered by popup. (as they might appear on top)<br>
-	 * By default this is true (before this flag was added).
-	 * 
-	 * @return true if the fix/workaround should be used for IE and Opera, false otherwise.
-	 */
-	public boolean getUseHideShowCoveredIEFix()
-	{
-		return useHideShowCoveredIEFix;
-	}
-
-	/**
 	 * Indicates whether the autocomplete list will be shown if the input is empty.
 	 * 
 	 * @return true if the autocomlete list will be shown if the input string is empty, false
@@ -351,25 +338,10 @@ public final class AutoCompleteSettings implements IClusterable
 	}
 
 	/**
-	 * Indicates whether in case of IE (and Opera), "select" "iframe" and "applet" tags should be
-	 * hidden if covered by popup. (as they might appear on top)<br>
-	 * By default this is true (before this flag was added).
-	 * 
-	 * @param useHideShowCoveredIEFix
-	 *            the flag
-	 * @return this {@link AutoCompleteSettings}.
-	 */
-	public AutoCompleteSettings setUseHideShowCoveredIEFix(final boolean useHideShowCoveredIEFix)
-	{
-		this.useHideShowCoveredIEFix = useHideShowCoveredIEFix;
-		return this;
-	}
-
-	/**
 	 * Sets the name of the request parameter that will bring the value of the user input
-	 *
+	 * 
 	 * @param parameterName
-	 *      the name of the request parameter that will bring the value of the user input
+	 *            the name of the request parameter that will bring the value of the user input
 	 * @return this {@link AutoCompleteSettings}
 	 */
 	public AutoCompleteSettings setParameterName(final String parameterName)

http://git-wip-us.apache.org/repos/asf/wicket/blob/83522306/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
index 3301a19..ac0f01a 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
@@ -67,11 +67,6 @@
 		var scrollbarSize = 0;
 		var selChSinceLastRender = false;
 
-		// this are the last visible and non-temporary bounds of the pop-up; the may change position and size several times when showing/updating choices and so on
-		// before it reaches the bounds that will be visible by the user (this is because of height/width settings limits or because it tries to compute preferred size);
-		// used for IE fix with hideShowCovered() - to be able to call it when bounds change while popup is visible.
-		var lastStablePopupBounds = [0, 0, 0, 0];
-
 		// holds a throttler, for not sending many requests if the user types
 		// too quickly.
 		var localThrottler = new Wicket.Throttler(true);
@@ -407,10 +402,7 @@
 
 			calculateAndSetPopupBounds(input, container);
 
-			if (visible === 0) {
-				visible = 1;
-				hideShowCovered(true, lastStablePopupBounds[0], lastStablePopupBounds[1], lastStablePopupBounds[2], lastStablePopupBounds[3]);
-			}
+			visible = 1;
 		}
 
 		function initializeUsefulDimensions(input, container) {
@@ -437,7 +429,6 @@
 			var container = getAutocompleteContainer();
 			if (container)
 			{
-				hideShowCovered(false, lastStablePopupBounds[0], lastStablePopupBounds[1], lastStablePopupBounds[2], lastStablePopupBounds[3]);
 				container.hide();
 				if (!cfg.adjustInputWidth && container.style.width !== "auto") {
 					container.style.width = "auto"; // let browser auto-set width again next time it is shown
@@ -554,17 +545,6 @@
 			}
 			popup.style.left=leftPosition+'px';
 			popup.style.top=topPosition+'px';
-
-			if (visible === 1 &&
-					(lastStablePopupBounds[0] !== popup.offsetLeft ||
-					 lastStablePopupBounds[1] !== popup.offsetTop ||
-					 lastStablePopupBounds[2] !== popup.offsetWidth ||
-					 lastStablePopupBounds[3] !== popup.offsetHeight)) {
-				hideShowCovered(false, lastStablePopupBounds[0], lastStablePopupBounds[1], lastStablePopupBounds[2], lastStablePopupBounds[3]); // show previously hidden
-				hideShowCovered(true, popup.offsetLeft, popup.offsetTop, popup.offsetWidth, popup.offsetHeight); // hide ones under new bounds
-			}
-
-			lastStablePopupBounds = [popup.offsetLeft, popup.offsetTop, popup.offsetWidth, popup.offsetHeight];
 		}
 
 		function getPosition(obj) {
@@ -828,37 +808,6 @@
 			return index;
 		}
 
-		function hideShowCovered(popupVisible, acLeftX, acTopY, acWidth, acHeight) {
-			if (!cfg.useHideShowCoveredIEFix || (!/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent))) {
-				return;
-			}
-
-			var hideTags=["select","iframe","applet"];
-			var acRightX = acLeftX + acWidth;
-			var acBottomY = acTopY + acHeight;
-
-			for (var j=0;j<hideTags.length;j++) {
-				var tagsFound=document.getElementsByTagName(hideTags[j]);
-				for (var i=0; i<tagsFound.length; i++){
-					var tag=tagsFound[i];
-					var p=getPosition(tag); // maybe determine only visible area of tag somehow? as it could be in a small scrolled container...
-					var leftX=p[0];
-					var rightX=leftX+tag.offsetWidth;
-					var topY=p[1];
-					var bottomY=topY+tag.offsetHeight;
-
-					if (!tag.wicket_element_visibility) {
-						tag.wicket_element_visibility=isVisible(tag);
-					}
-					if (!popupVisible || (leftX>acRightX) || (rightX<acLeftX) || (topY>acBottomY) || (bottomY<acTopY)) {
-						tag.style.visibility = tag.wicket_element_visibility;
-					} else {
-						tag.style.visibility = "hidden";
-					}
-				}
-			}
-		}
-
 		initialize();
 	};
 })();
\ No newline at end of file