diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-03-25 07:45:51 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-03-25 07:45:51 +0000 |
commit | 66f7282862aeddd9a0eb37bb1a522fdd501ff649 (patch) | |
tree | 5f6f376489edd9c37bfa386cd8c1fa93fcb572fd /src | |
parent | 8ac824d4891b3db91ab3be14507e68a03a82eeea (diff) | |
download | vaadin-framework-66f7282862aeddd9a0eb37bb1a522fdd501ff649.tar.gz vaadin-framework-66f7282862aeddd9a0eb37bb1a522fdd501ff649.zip |
Merged bugfixes and test updates from 6.5
svn changeset:17929/svn branch:6.6
Diffstat (limited to 'src')
4 files changed, 46 insertions, 9 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index 305b0c3ebe..71e4b1ec03 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -103,6 +103,15 @@ public class VTree extends SimpleFocusablePanel implements Paintable, private boolean selectionHasChanged = false; + public VLazyExecutor iconLoaded = new VLazyExecutor(50, + new ScheduledCommand() { + + public void execute() { + Util.notifyParentOfSizeChange(VTree.this, true); + } + + }); + public VTree() { super(); setStyleName(CLASSNAME); @@ -514,6 +523,11 @@ public class VTree extends SimpleFocusablePanel implements Paintable, private boolean focused = false; + /** + * Track onload events as IE6 sends two + */ + private boolean onloadHandled = false; + public TreeNode() { constructDom(); sinkEvents(Event.ONCLICK | Event.ONDBLCLICK | Event.MOUSEEVENTS @@ -684,11 +698,23 @@ public class VTree extends SimpleFocusablePanel implements Paintable, @Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); + final int type = DOM.eventGetType(event); + final Element target = DOM.eventGetTarget(event); + + if (type == Event.ONLOAD && target == icon.getElement()) { + if (onloadHandled) { + return; + } + if (BrowserInfo.get().isIE6()) { + fixWidth(); + } + iconLoaded.trigger(); + onloadHandled = true; + } + if (disabled) { return; } - final int type = DOM.eventGetType(event); - final Element target = DOM.eventGetTarget(event); final boolean inCaption = target == nodeCaptionSpan || (icon != null && target == icon.getElement()); if (inCaption @@ -891,6 +917,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable, if (uidl.hasAttribute("icon")) { if (icon == null) { + onloadHandled = false; icon = new Icon(client); DOM.insertBefore(DOM.getFirstChild(nodeCaptionDiv), icon.getElement(), nodeCaptionSpan); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 5d7cc18945..b2be2a6daf 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -675,9 +675,16 @@ public class VView extends SimplePanel implements Container, ResizeHandler, DOM.setElementProperty(getElement(), "tabIndex", "1"); RootPanel root = RootPanel.get(rootPanelId); - root.add(this); + + // Remove the v-app-loading or any splash screen added inside the div by + // the user + root.getElement().setInnerHTML(""); + // For backwards compatibility with static index pages only. + // No longer added by AbstractApplicationServlet/Portlet root.removeStyleName("v-app-loading"); + root.add(this); + BrowserInfo browser = BrowserInfo.get(); // set focus to iview element by default to listen possible keyboard @@ -708,7 +715,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler, } public void focus() { - getElement().focus(); + getElement().focus(); } } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 4f93afff56..e64cd6f243 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -926,8 +926,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet String themeClass = "v-theme-" + themeName.replaceAll("[^a-zA-Z0-9]", ""); - String classNames = "v-app v-app-loading " + themeClass + " " - + appClass; + String classNames = "v-app " + themeClass + " " + appClass; String style = getApplicationProperty(PORTLET_PARAMETER_STYLE); String divStyle = ""; @@ -1225,7 +1224,9 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet RenderResponse response, final BufferedWriter writer, String id, String classNames, String divStyle) throws IOException { writer.write("<div id=\"" + id + "\" class=\"" + classNames + "\" " - + divStyle + "></div>\n"); + + divStyle + ">"); + writer.write("<div class=\"v-app-loading\"></div>"); + writer.write("</div>\n"); writer.write("<noscript>" + getNoScriptMessage() + "</noscript>"); } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 36dd30e364..a9e5f2c827 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -1660,7 +1660,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements + getDefaultTheme().replaceAll("[^a-zA-Z0-9]", ""); } - String classNames = "v-app v-app-loading " + themeClass + " " + String classNames = "v-app " + themeClass + " " + appClass; String divStyle = null; @@ -1744,7 +1744,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements String appId, String classNames, String divStyle, HttpServletRequest request) throws IOException { page.write("<div id=\"" + appId + "\" class=\"" + classNames + "\" " - + (divStyle != null ? divStyle : "") + "></div>\n"); + + (divStyle != null ? divStyle : "") + ">"); + page.write("<div class=\"v-app-loading\"></div>"); + page.write("</div>\n"); page.write("<noscript>" + getNoScriptMessage() + "</noscript>"); } |