Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1722)

Unified Diff: Source/web/resources/calendarPicker.js

Issue 195443002: CalendarPicker display in correct format for minimum Value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update content to issue partition change event Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/resources/calendarPicker.js
diff --git a/Source/web/resources/calendarPicker.js b/Source/web/resources/calendarPicker.js
index 7f28be81849dc1297b6801a4bbb3cd0ad2237c21..d811070c6fcccc815eb92dbee6d12413bd287cfe 100644
--- a/Source/web/resources/calendarPicker.js
+++ b/Source/web/resources/calendarPicker.js
@@ -1522,16 +1522,29 @@ ScrollView.prototype.setContentOffset = function(value) {
value = Math.min(this.maximumContentOffset - this._height, Math.max(this.minimumContentOffset, Math.floor(value)));
if (this._contentOffset === value)
return;
- var newPartitionNumber = Math.floor(value / ScrollView.PartitionHeight);
+ this._contentOffset = value;
+ this._updateScrollContent();
+ if (this.delegate)
+ this.delegate.scrollViewDidChangeContentOffset(this);
+};
+
+ScrollView.prototype._updateScrollContent = function() {
+ var newPartitionNumber = Math.floor(this._contentOffset / ScrollView.PartitionHeight);
var partitionChanged = this._partitionNumber !== newPartitionNumber;
this._partitionNumber = newPartitionNumber;
- this._contentOffset = value;
this.contentElement.style.webkitTransform = "translate(0, " + (-this.contentPositionForContentOffset(this._contentOffset)) + "px)";
- if (this.delegate) {
- this.delegate.scrollViewDidChangeContentOffset(this);
- if (partitionChanged)
- this.delegate.scrollViewDidChangePartition(this);
- }
+ if (this.delegate && partitionChanged)
+ this.delegate.scrollViewDidChangePartition(this);
+};
+
+/**
+ * @param {!View|Node} parent
+ * @param {?View|Node=} before
+ * @override
+ */
+ScrollView.prototype.attachTo = function(parent, before) {
+ View.prototype.attachTo.call(this, parent, before);
+ this._updateScrollContent();
};
/**
« no previous file with comments | « LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698