summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-09-10 12:32:24 +0300
committerJohn Ahlroos <john@vaadin.com>2012-09-10 12:32:24 +0300
commit00f75c5a162e58e04d6d6f087ccceab98dfdf1f0 (patch)
tree6b72d611dbd61ae48975ebb5c4b03da4435fb1fe /client
parent9015ff64aa0a5503e29aa57b0d66e0aa6892e315 (diff)
parentb4e243c87d4b4f28fa18affecb855b8731682a59 (diff)
downloadvaadin-framework-00f75c5a162e58e04d6d6f087ccceab98dfdf1f0.tar.gz
vaadin-framework-00f75c5a162e58e04d6d6f087ccceab98dfdf1f0.zip
Merge branch '6.8'
Conflicts: WebContent/VAADIN/themes/base/common/common.scss server/src/com/vaadin/server/VaadinServlet.java server/src/com/vaadin/ui/AbstractField.java src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.java tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.java tests/testbench/com/vaadin/tests/tickets/Ticket8291.java uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java uitest/src/com/vaadin/tests/tickets/Ticket8291.java uitest/test.xml
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/BrowserInfo.java10
-rw-r--r--client/src/com/vaadin/client/ui/datefield/VCalendarPanel.java21
2 files changed, 22 insertions, 9 deletions
diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java
index f7c8d2f331..e32e9b65f0 100644
--- a/client/src/com/vaadin/client/BrowserInfo.java
+++ b/client/src/com/vaadin/client/BrowserInfo.java
@@ -360,13 +360,15 @@ public class BrowserInfo {
if (!isTouchDevice()) {
return false;
}
+ // TODO Should test other Android browsers, especially Chrome
if (isAndroid() && isWebkit() && getWebkitVersion() >= 534) {
return false;
}
- // Cannot enable native touch scrolling on iOS 5 until #8792 is resolved
- // if (isIOS() && isWebkit() && getWebkitVersion() >= 534) {
- // return false;
- // }
+ // iOS 6 Safari supports native scrolling; iOS 5 suffers from #8792
+ // TODO Should test other iOS browsers
+ if (isIOS() && isSafari() && getBrowserMajorVersion() >= 6) {
+ return false;
+ }
return true;
}
diff --git a/client/src/com/vaadin/client/ui/datefield/VCalendarPanel.java b/client/src/com/vaadin/client/ui/datefield/VCalendarPanel.java
index dc40675e0a..9d519e3179 100644
--- a/client/src/com/vaadin/client/ui/datefield/VCalendarPanel.java
+++ b/client/src/com/vaadin/client/ui/datefield/VCalendarPanel.java
@@ -135,8 +135,16 @@ public class VCalendarPanel extends FocusableFlexTable implements
*/
@Override
public void onClick(ClickEvent event) {
- Day day = (Day) event.getSource();
- focusDay(day.getDate());
+ Date newDate = ((Day) event.getSource()).getDate();
+ if (newDate.getMonth() != displayedMonth.getMonth()
+ || newDate.getYear() != displayedMonth.getYear()) {
+ // If an off-month date was clicked, we must change the
+ // displayed month and re-render the calendar (#8931)
+ displayedMonth.setMonth(newDate.getMonth());
+ displayedMonth.setYear(newDate.getYear());
+ renderCalendar();
+ }
+ focusDay(newDate);
selectFocused();
onSubmit();
}
@@ -403,8 +411,8 @@ public class VCalendarPanel extends FocusableFlexTable implements
}
final String monthName = needsMonth ? getDateTimeService().getMonth(
- focusedDate.getMonth()) : "";
- final int year = focusedDate.getYear() + 1900;
+ displayedMonth.getMonth()) : "";
+ final int year = displayedMonth.getYear() + 1900;
getFlexCellFormatter().setStyleName(0, 2,
VDateField.CLASSNAME + "-calendarpanel-month");
setHTML(0, 2, "<span class=\"" + VDateField.CLASSNAME
@@ -605,14 +613,17 @@ public class VCalendarPanel extends FocusableFlexTable implements
*/
private void focusNextDay(int days) {
int oldMonth = focusedDate.getMonth();
+ int oldYear = focusedDate.getYear();
focusedDate.setDate(focusedDate.getDate() + days);
- if (focusedDate.getMonth() == oldMonth) {
+ if (focusedDate.getMonth() == oldMonth
+ && focusedDate.getYear() == oldYear) {
// Month did not change, only move the selection
focusDay(focusedDate);
} else {
// If the month changed we need to re-render the calendar
displayedMonth.setMonth(focusedDate.getMonth());
+ displayedMonth.setYear(focusedDate.getYear());
renderCalendar();
}
}