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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 "use strict"; 1 "use strict";
2 /* 2 /*
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 1515
1516 1516
1517 /** 1517 /**
1518 * @param {!number} value 1518 * @param {!number} value
1519 */ 1519 */
1520 ScrollView.prototype.setContentOffset = function(value) { 1520 ScrollView.prototype.setContentOffset = function(value) {
1521 console.assert(isFinite(value)); 1521 console.assert(isFinite(value));
1522 value = Math.min(this.maximumContentOffset - this._height, Math.max(this.min imumContentOffset, Math.floor(value))); 1522 value = Math.min(this.maximumContentOffset - this._height, Math.max(this.min imumContentOffset, Math.floor(value)));
1523 if (this._contentOffset === value) 1523 if (this._contentOffset === value)
1524 return; 1524 return;
1525 var newPartitionNumber = Math.floor(value / ScrollView.PartitionHeight); 1525 this._contentOffset = value;
1526 this._updateScrollContent();
1527 if (this.delegate)
1528 this.delegate.scrollViewDidChangeContentOffset(this);
1529 };
1530
1531 ScrollView.prototype._updateScrollContent = function() {
1532 var newPartitionNumber = Math.floor(this._contentOffset / ScrollView.Partiti onHeight);
1526 var partitionChanged = this._partitionNumber !== newPartitionNumber; 1533 var partitionChanged = this._partitionNumber !== newPartitionNumber;
1527 this._partitionNumber = newPartitionNumber; 1534 this._partitionNumber = newPartitionNumber;
1528 this._contentOffset = value;
1529 this.contentElement.style.webkitTransform = "translate(0, " + (-this.content PositionForContentOffset(this._contentOffset)) + "px)"; 1535 this.contentElement.style.webkitTransform = "translate(0, " + (-this.content PositionForContentOffset(this._contentOffset)) + "px)";
1530 if (this.delegate) { 1536 if (this.delegate && partitionChanged)
1531 this.delegate.scrollViewDidChangeContentOffset(this); 1537 this.delegate.scrollViewDidChangePartition(this);
1532 if (partitionChanged)
1533 this.delegate.scrollViewDidChangePartition(this);
1534 }
1535 }; 1538 };
1536 1539
1537 /** 1540 /**
1541 * @param {!View|Node} parent
1542 * @param {?View|Node=} before
1543 * @override
1544 */
1545 ScrollView.prototype.attachTo = function(parent, before) {
1546 View.prototype.attachTo.call(this, parent, before);
1547 this._updateScrollContent();
1548 };
1549
1550 /**
1538 * @param {!number} offset 1551 * @param {!number} offset
1539 */ 1552 */
1540 ScrollView.prototype.contentPositionForContentOffset = function(offset) { 1553 ScrollView.prototype.contentPositionForContentOffset = function(offset) {
1541 return offset - this._partitionNumber * ScrollView.PartitionHeight; 1554 return offset - this._partitionNumber * ScrollView.PartitionHeight;
1542 }; 1555 };
1543 1556
1544 /** 1557 /**
1545 * @constructor 1558 * @constructor
1546 * @extends View 1559 * @extends View
1547 */ 1560 */
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after
4025 event.stopPropagation(); 4038 event.stopPropagation();
4026 event.preventDefault(); 4039 event.preventDefault();
4027 } 4040 }
4028 } 4041 }
4029 4042
4030 if (window.dialogArguments) { 4043 if (window.dialogArguments) {
4031 initialize(dialogArguments); 4044 initialize(dialogArguments);
4032 } else { 4045 } else {
4033 window.addEventListener("message", handleMessage, false); 4046 window.addEventListener("message", handleMessage, false);
4034 } 4047 }
OLDNEW
« 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