Browse Source

Split VOverlay functionality to a new base class (#19347)

This fixes the missing z-index for the Grid popup.

Change-Id: I5474fe653ad4ece38e9bc3cb2331a1d2190ea898
tags/7.7.0.alpha1
Teemu Suo-Anttila 8 years ago
parent
commit
a963263017

+ 39
- 36
client/src/com/vaadin/DefaultWidgetSet.gwt.xml View File

@@ -1,39 +1,42 @@
<module>
<!-- This GWT module defines the Vaadin DefaultWidgetSet. This is the
module you want to extend when creating an extended widget set, or when creating
a specialized widget set with a subset of the components. -->

<!-- Hint for WidgetSetBuilder not to automatically update the file -->
<!-- WS Compiler: manually edited -->

<inherits name="com.vaadin.Vaadin" />

<!-- Elemental is used for handling Json only -->
<inherits name="elemental.Json" />
<inherits name="com.google.gwt.precompress.Precompress"/>

<entry-point class="com.vaadin.client.ApplicationConfiguration" />

<generate-with
class="com.vaadin.server.widgetsetutils.AcceptCriteriaFactoryGenerator">
<when-type-is class="com.vaadin.client.ui.dd.VAcceptCriterionFactory" />
</generate-with>

<generate-with
class="com.vaadin.server.widgetsetutils.ConnectorBundleLoaderFactory">
<when-type-assignable
class="com.vaadin.client.metadata.ConnectorBundleLoader" />
</generate-with>

<replace-with
class="com.vaadin.client.communication.DefaultReconnectDialog">
<when-type-is class="com.vaadin.client.communication.ReconnectDialog" />
</replace-with>

<!-- Since 7.2. Compile all permutations (browser support) into one Javascript
file. Speeds up compilation and does not make the Javascript significantly
larger. -->
<collapse-all-properties />
<!-- This GWT module defines the Vaadin DefaultWidgetSet. This is the module
you want to extend when creating an extended widget set, or when creating
a specialized widget set with a subset of the components. -->

<!-- Hint for WidgetSetBuilder not to automatically update the file -->
<!-- WS Compiler: manually edited -->

<inherits name="com.vaadin.Vaadin" />

<!-- Elemental is used for handling Json only -->
<inherits name="elemental.Json" />

<inherits name="com.google.gwt.precompress.Precompress" />

<entry-point class="com.vaadin.client.ApplicationConfiguration" />

<generate-with
class="com.vaadin.server.widgetsetutils.AcceptCriteriaFactoryGenerator">
<when-type-is class="com.vaadin.client.ui.dd.VAcceptCriterionFactory" />
</generate-with>

<generate-with
class="com.vaadin.server.widgetsetutils.ConnectorBundleLoaderFactory">
<when-type-assignable
class="com.vaadin.client.metadata.ConnectorBundleLoader" />
</generate-with>

<replace-with class="com.vaadin.client.communication.DefaultReconnectDialog">
<when-type-is class="com.vaadin.client.communication.ReconnectDialog" />
</replace-with>

<replace-with class="com.vaadin.client.ui.VOverlay">
<when-type-is class="com.vaadin.client.widgets.Overlay" />
</replace-with>

<!-- Since 7.2. Compile all permutations (browser support) into one Javascript
file. Speeds up compilation and does not make the Javascript significantly
larger. -->
<collapse-all-properties />

</module>

+ 18
- 945
client/src/com/vaadin/client/ui/VOverlay.java
File diff suppressed because it is too large
View File


+ 3
- 29
client/src/com/vaadin/client/widgets/Grid.java View File

@@ -34,7 +34,6 @@ import java.util.logging.Logger;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.BodyElement;
import com.google.gwt.dom.client.BrowserEvents;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
@@ -3620,7 +3619,7 @@ public class Grid<T> extends ResizeComposite implements

private final Grid<?> grid;

private PopupPanel overlay;
private Overlay overlay;

private Sidebar(Grid<?> grid) {
this.grid = grid;
@@ -3712,33 +3711,8 @@ public class Grid<T> extends ResizeComposite implements
* Creates and initializes the overlay.
*/
private void createOverlay() {
overlay = new PopupPanel() {

@Override
protected void onAttach() {
// PopupPanel by default attaches itself directly to the
// body. Try to find a Vaadin overlay container and move the
// overlay there if found.

// FIXME: This is a hack; Grid should not have
// Vaadin-specific behavior special-cased. Instead, there
// should be a customization point for setting the overlay
// container.

BodyElement body = Document.get().getBody();
Element target = body.getFirstChildElement();
while (!target.hasClassName("v-overlay-container")
&& target != null) {
target = target.getNextSiblingElement();
}

if (target != null) {
target.appendChild(getElement());
}

super.onAttach();
}
};
overlay = GWT.create(Overlay.class);
overlay.setOwner(grid);
overlay.setAutoHideEnabled(true);
overlay.addStyleDependentName("popup");
overlay.add(content);

+ 1010
- 0
client/src/com/vaadin/client/widgets/Overlay.java
File diff suppressed because it is too large
View File


+ 1
- 0
widgets/build.xml View File

@@ -45,6 +45,7 @@
<fileset dir="${result.deps}">
<include name="com/vaadin/*.gwt.xml" />
<include name="com/vaadin/client/BrowserInfo.java" />
<include name="com/vaadin/client/AnimationUtil.java" />
<include name="com/vaadin/client/ComputedStyle.java" />
<include name="com/vaadin/client/DeferredWorker.java" />
<include name="com/vaadin/client/Profiler.java" />

Loading…
Cancel
Save