aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-08-06 15:08:17 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-08-06 15:08:17 +0000
commit458f8bed858f72af8c15086220dd18dfe0abe804 (patch)
treef8fd92feb8bc04b108941cb2b4f0b5a5c156cd88 /src
parent763f77fc2f3b3c3c1ce2fa91ae2a8097b11f6b6b (diff)
downloadvaadin-framework-458f8bed858f72af8c15086220dd18dfe0abe804.tar.gz
vaadin-framework-458f8bed858f72af8c15086220dd18dfe0abe804.zip
Moved #9136 fix into a helper method
svn changeset:24088/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java37
1 files changed, 12 insertions, 25 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index 2d318522ea..c32e035e1c 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -714,7 +714,7 @@ public class VTree extends FocusElementPanel implements Paintable,
focus();
}
- ScheduledCommand command = new ScheduledCommand() {
+ executeEventCommand(new ScheduledCommand() {
public void execute() {
if (multiSelectMode == MULTISELECT_MODE_SIMPLE
@@ -748,21 +748,7 @@ public class VTree extends FocusElementPanel implements Paintable,
}
}
}
- };
-
- if (BrowserInfo.get().isWebkit() && !treeHasFocus) {
- /*
- * Safari may need to wait for focus. See FocusImplSafari.
- *
- * Note that this if/else must exactly match the one in
- * fireClick() to ensure that the above click/selection event
- * logic works correctly (#9136)
- */
- // VConsole.log("Deferring click handling to let webkit gain focus...");
- Scheduler.get().scheduleDeferred(command);
- } else {
- command.execute();
- }
+ });
return true;
}
@@ -906,7 +892,8 @@ public class VTree extends FocusElementPanel implements Paintable,
}
}
final MouseEventDetails details = new MouseEventDetails(evt);
- ScheduledCommand command = new ScheduledCommand() {
+
+ executeEventCommand(new ScheduledCommand() {
public void execute() {
// Determine if we should send the event immediately to the
// server. We do not want to send the event if there is a
@@ -933,15 +920,15 @@ public class VTree extends FocusElementPanel implements Paintable,
client.updateVariable(paintableId, "clickEvent",
details.toString(), sendClickEventNow);
}
- };
+ });
+ }
+
+ /*
+ * Must wait for Safari to focus before sending click and value change
+ * events (see #6373, #6374)
+ */
+ private void executeEventCommand(ScheduledCommand command) {
if (BrowserInfo.get().isWebkit() && !treeHasFocus) {
- /*
- * Webkits need a deferring due to FocusImplSafari uses timeout
- *
- * Note that this if/else must exactly match the one in
- * handleClickSelection() to ensure that the above
- * click/selection event logic works correctly (#9136)
- */
Scheduler.get().scheduleDeferred(command);
} else {
command.execute();