Changeset 127727 in webkit
- Timestamp:
- Sep 6, 2012 4:05:27 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127722 r127727 1 2012-09-06 Keishi Hattori <keishi@webkit.org> 2 3 Refactor CalendarPicker to not use global variables. 4 https://bugs.webkit.org/show_bug.cgi?id=95830 5 6 Reviewed by Kent Tamura. 7 8 * fast/forms/date/calendar-picker-appearance-pre-100.html: 9 1 10 2012-09-06 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 11 -
trunk/LayoutTests/fast/forms/date/calendar-picker-appearance-pre-100.html
r125962 r127727 9 9 <input type=date id=date value="0002-02-02"> 10 10 <script> 11 function sendKey( input, keyName) {11 function sendKey(element, keyName) { 12 12 var event = document.createEvent('KeyboardEvent'); 13 13 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName); 14 input.dispatchEvent(event);14 element.dispatchEvent(event); 15 15 } 16 16 17 17 function finishTest() { 18 18 pickerWindow.removeEventListener('resize', finishTest); 19 sendKey(pickerWindow.global.daysTable._daysContainer, 'Right'); 20 sendKey(pickerWindow.global.daysTable._daysContainer, 'Enter'); 19 var daysContainer = pickerWindow.document.getElementsByClassName("days-area")[0]; 20 sendKey(daysContainer, 'Right'); 21 sendKey(daysContainer, 'Enter'); 21 22 shouldBe('document.getElementById("date").value', '"0002-02-03"'); 22 23 setTimeout(function() { finishJSTest(); }, 0); -
trunk/Source/WebCore/ChangeLog
r127724 r127727 1 2012-09-06 Keishi Hattori <keishi@webkit.org> 2 3 Refactor CalendarPicker to not use global variables. 4 https://bugs.webkit.org/show_bug.cgi?id=95830 5 6 Reviewed by Kent Tamura. 7 8 Introduce CalendarPicker so we can have multiple Pickers in one page 9 popup in the future. 10 11 No new tests. No behavior change. 12 13 * Resources/pagepopups/calendarPicker.js: 14 (initialize): 15 (resetMain): 16 (openCalendarPicker): 17 (CalendarPicker): 18 (CalendarPicker.prototype._layout): 19 (CalendarPicker.prototype.handleToday): 20 (CalendarPicker.prototype.handleClear): 21 (CalendarPicker.prototype.fixWindowSize): 22 (CalendarPicker.prototype._layoutButtons): 23 (YearMonthController): 24 (YearMonthController.prototype.attachTo): 25 (YearMonthController.prototype._redraw): 26 (YearMonthController.prototype._handleYearMonthChange): 27 (YearMonthController.prototype.moveRelatively): 28 (DaysTable): 29 (DaysTable.prototype.attachTo): 30 (CalendarPicker.prototype.stepMismatch): 31 (CalendarPicker.prototype.outOfRange): 32 (CalendarPicker.prototype.isValidDate): 33 (DaysTable.prototype._renderMonth): 34 (DaysTable.prototype._navigateToMonth): 35 (DaysTable.prototype._maybeSetPreviousMonth): 36 (DaysTable.prototype._maybeSetNextMonth): 37 (DaysTable.prototype._handleDayClick): 38 (DaysTable.prototype._handleKey): 39 (CalendarPicker.prototype._handleBodyKeyDown): 40 * Resources/pagepopups/colorSuggestionPicker.js: 41 (ColorPicker): 42 (ColorPicker.prototype._layout): 43 (ColorPicker.prototype._handleKeyDown): 44 (ColorPicker.prototype._handleSwatchClick): 45 * Resources/pagepopups/pickerCommon.js: 46 (Picker): 47 (Picker.prototype.submitValue): 48 (Picker.prototype.handleCancel): 49 (Picker.prototype.chooseOtherColor): 50 1 51 2012-09-06 Simon Hausmann <simon.hausmann@nokia.com> 2 52 -
trunk/Source/WebCore/Resources/pagepopups/calendarPicker.js
r125962 r127727 277 277 } else { 278 278 global.params = args; 279 checkLimits(); 280 layout(); 281 282 var initialDate = parseDateString(args.currentValue); 283 if (initialDate < global.minimumDate) 284 initialDate = global.minimumDate; 285 else if (initialDate > global.maximumDate) 286 initialDate = global.maximumDate; 287 global.daysTable.selectDate(initialDate); 288 289 setTimeout(fixWindowSize, 0); 290 } 291 } 292 293 function fixWindowSize() { 294 var yearMonthRightElement = document.getElementsByClassName(ClassNames.YearMonthButtonRight)[0]; 295 var daysAreaElement = document.getElementsByClassName(ClassNames.DaysArea)[0]; 279 openCalendarPicker(); 280 } 281 } 282 283 function resetMain() { 284 var main = $("main"); 285 main.innerHTML = ""; 286 main.className = ""; 287 }; 288 289 function openCalendarPicker() { 290 resetMain(); 291 new CalendarPicker($("main"), global.params); 292 }; 293 294 /** 295 * @constructor 296 * @param {!Element} element 297 * @param {!Object} config 298 */ 299 function CalendarPicker(element, config) { 300 Picker.call(this, element, config); 301 // We assume this._config.min is a valid date. 302 this.minimumDate = (typeof this._config.min !== "undefined") ? parseDateString(this._config.min) : CalendarPicker.MinimumPossibleDate; 303 // We assume this._config.max is a valid date. 304 this.maximumDate = (typeof this._config.max !== "undefined") ? parseDateString(this._config.max) : CalendarPicker.MaximumPossibleDate; 305 this.step = (typeof this._config.step !== undefined) ? this._config.step * CalendarPicker.BaseStep : CalendarPicker.BaseStep; 306 this.yearMonthController = new YearMonthController(this); 307 this.daysTable = new DaysTable(this); 308 this._layout(); 309 var initialDate = parseDateString(this._config.currentValue); 310 if (initialDate < this.minimumDate) 311 initialDate = this.minimumDate; 312 else if (initialDate > this.maximumDate) 313 initialDate = this.maximumDate; 314 this.daysTable.selectDate(initialDate); 315 this.fixWindowSize(); 316 document.body.addEventListener("keydown", bind(this._handleBodyKeyDown, this), false); 317 } 318 CalendarPicker.prototype = Object.create(Picker.prototype); 319 320 // Hard limits of type=date. See WebCore/platform/DateComponents.h. 321 CalendarPicker.MinimumPossibleDate = new Date(-62135596800000.0); 322 CalendarPicker.MaximumPossibleDate = new Date(8640000000000000.0); 323 // See WebCore/html/DateInputType.cpp. 324 CalendarPicker.BaseStep = 86400000; 325 326 CalendarPicker.prototype._layout = function() { 327 this._element.style.direction = global.params.isRTL ? "rtl" : "ltr"; 328 this.yearMonthController.attachTo(this._element); 329 this.daysTable.attachTo(this._element); 330 this._layoutButtons(); 331 }; 332 333 CalendarPicker.prototype.handleToday = function() { 334 var date = new Date(); 335 this.daysTable.selectDate(date); 336 this.submitValue(serializeDate(date.getFullYear(), date.getMonth(), date.getDate())); 337 }; 338 339 CalendarPicker.prototype.handleClear = function() { 340 this.submitValue(""); 341 }; 342 343 CalendarPicker.prototype.fixWindowSize = function() { 344 var yearMonthRightElement = this._element.getElementsByClassName(ClassNames.YearMonthButtonRight)[0]; 345 var daysAreaElement = this._element.getElementsByClassName(ClassNames.DaysArea)[0]; 296 346 var headers = daysAreaElement.getElementsByClassName(ClassNames.DayLabel); 297 347 var maxCellWidth = 0; … … 301 351 } 302 352 var DaysAreaContainerBorder = 1; 303 var main = $("main");304 353 var yearMonthEnd; 305 354 var daysAreaEnd; 306 355 if (global.params.isRTL) { 307 var startOffset = main.offsetLeft + main.offsetWidth;356 var startOffset = this._element.offsetLeft + this._element.offsetWidth; 308 357 yearMonthEnd = startOffset - yearMonthRightElement.offsetLeft; 309 358 daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + maxCellWidth * 7 + DaysAreaContainerBorder; … … 312 361 daysAreaEnd = daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder; 313 362 } 314 315 363 var maxEnd = Math.max(yearMonthEnd, daysAreaEnd); 316 var MainPadding = 6; 364 var MainPadding = 6; // FIXME: Fix name. 317 365 var MainBorder = 1; 318 366 var desiredBodyWidth = maxEnd + MainPadding + MainBorder; 319 367 320 var mainHeight = main.offsetHeight;321 main.style.width = "auto";368 var elementHeight = this._element.offsetHeight; 369 this._element.style.width = "auto"; 322 370 daysAreaElement.style.width = "100%"; 323 371 daysAreaElement.style.tableLayout = "fixed"; 324 document.getElementsByClassName(ClassNames.YearMonthUpper)[0].style.display = "-webkit-box"; 325 document.getElementsByClassName(ClassNames.MonthSelectorBox)[0].style.display = "block"; 326 resizeWindow(desiredBodyWidth, mainHeight); 327 } 328 329 function checkLimits() { 330 // Hard limits of type=date. See WebCore/platform/DateComponents.h. 331 global.minimumDate = new Date(-62135596800000.0); 332 global.maximumDate = new Date(8640000000000000.0); 333 // See WebCore/html/DateInputType.cpp. 334 global.step = 86400000; 335 336 if (global.params.min) { 337 // We assume params.min is a valid date. 338 global.minimumDate = parseDateString(global.params.min); 339 } 340 if (global.params.max) { 341 // We assume params.max is a valid date. 342 global.maximumDate = parseDateString(global.params.max); 343 } 344 if (global.params.step) 345 global.step *= global.params.step; 346 } 347 348 function layout() { 349 if (global.params.isRTL) 350 document.body.dir = "rtl"; 351 else 352 document.body.dir = "ltr"; 353 var main = $("main"); 354 var params = global.params; 355 main.removeChild(main.firstChild); 356 document.body.addEventListener("keydown", handleGlobalKey, false); 357 358 global.yearMonthController = new YearMonthController(); 359 global.yearMonthController.attachTo(main); 360 global.daysTable = new DaysTable(); 361 global.daysTable.attachTo(main); 362 layoutButtons(main); 363 } 364 365 /** 366 * @param {Element} main 367 */ 368 function layoutButtons(main) { 372 this._element.getElementsByClassName(ClassNames.YearMonthUpper)[0].style.display = "-webkit-box"; 373 this._element.getElementsByClassName(ClassNames.MonthSelectorBox)[0].style.display = "block"; 374 resizeWindow(desiredBodyWidth, elementHeight); 375 }; 376 377 CalendarPicker.prototype._layoutButtons = function() { 369 378 var container = createElement("div", ClassNames.TodayClearArea); 370 global.today = createElement("input", ClassNames.TodayButton);371 global.today.type = "button";372 global.today.value = global.params.todayLabel;373 global.today.addEventListener("click", handleToday, false);374 container.appendChild( global.today);375 global.clear = null;376 if (! global.params.required) {377 global.clear = createElement("input", ClassNames.ClearButton);378 global.clear.type = "button";379 global.clear.value = global.params.clearLabel;380 global.clear.addEventListener("click", handleClear, false);381 container.appendChild( global.clear);382 } 383 main.appendChild(container);384 385 global.lastFocusableControl = global.clear || global.today;386 } 379 this.today = createElement("input", ClassNames.TodayButton); 380 this.today.type = "button"; 381 this.today.value = this._config.todayLabel; 382 this.today.addEventListener("click", bind(this.handleToday, this), false); 383 container.appendChild(this.today); 384 this.clear = null; 385 if (!this._config.required) { 386 this.clear = createElement("input", ClassNames.ClearButton); 387 this.clear.type = "button"; 388 this.clear.value = this._config.clearLabel; 389 this.clear.addEventListener("click", bind(this.handleClear, this), false); 390 container.appendChild(this.clear); 391 } 392 this._element.appendChild(container); 393 394 this.lastFocusableControl = this.clear || this.today; 395 }; 387 396 388 397 // ---------------------------------------------------------------- … … 390 399 /** 391 400 * @constructor 392 */ 393 function YearMonthController() { 401 * @param {!CalendarPicker} picker 402 */ 403 function YearMonthController(picker) { 404 this.picker = picker; 394 405 /** 395 406 * @type {!number} … … 403 414 404 415 /** 405 * @param {!Element} main406 */ 407 YearMonthController.prototype.attachTo = function( main) {416 * @param {!Element} element 417 */ 418 YearMonthController.prototype.attachTo = function(element) { 408 419 var outerContainer = createElement("div", ClassNames.YearMonthArea); 409 420 … … 430 441 431 442 this._attachRightButtonsTo(innerContainer); 432 main.appendChild(outerContainer);443 element.appendChild(outerContainer); 433 444 434 445 this._wall = createElement("div", ClassNames.MonthSelectorWall); 435 446 this._wall.addEventListener("click", bind(this._closePopup, this), false); 436 main.appendChild(this._wall);437 438 var maximumYear = global.maximumDate.getUTCFullYear();447 element.appendChild(this._wall); 448 449 var maximumYear = this.picker.maximumDate.getUTCFullYear(); 439 450 var maxWidth = 0; 440 451 for (var m = 0; m < 12; ++m) { … … 535 546 536 547 YearMonthController.prototype._redraw = function() { 537 var min = global.minimumDate.getUTCFullYear() * 12 + global.minimumDate.getUTCMonth();538 var max = global.maximumDate.getUTCFullYear() * 12 + global.maximumDate.getUTCMonth();548 var min = this.picker.minimumDate.getUTCFullYear() * 12 + this.picker.minimumDate.getUTCMonth(); 549 var max = this.picker.maximumDate.getUTCFullYear() * 12 + this.picker.maximumDate.getUTCMonth(); 539 550 var current = this._currentYear * 12 + this._currentMonth; 540 551 if (this._left3) … … 681 692 var newYear = Number(result[1]); 682 693 var newMonth = Number(result[2]); 683 global.daysTable.navigateToMonthAndKeepSelectionPosition(newYear, newMonth);694 this.picker.daysTable.navigateToMonthAndKeepSelectionPosition(newYear, newMonth); 684 695 }; 685 696 … … 739 750 */ 740 751 YearMonthController.prototype.moveRelatively = function(amount) { 741 var min = global.minimumDate.getUTCFullYear() * 12 + global.minimumDate.getUTCMonth();742 var max = global.maximumDate.getUTCFullYear() * 12 + global.maximumDate.getUTCMonth();752 var min = this.picker.minimumDate.getUTCFullYear() * 12 + this.picker.minimumDate.getUTCMonth(); 753 var max = this.picker.maximumDate.getUTCFullYear() * 12 + this.picker.maximumDate.getUTCMonth(); 743 754 var current = this._currentYear * 12 + this._currentMonth; 744 755 var updated = current; … … 749 760 if (updated == current) 750 761 return; 751 global.daysTable.navigateToMonthAndKeepSelectionPosition(Math.floor(updated / 12), updated % 12);762 this.picker.daysTable.navigateToMonthAndKeepSelectionPosition(Math.floor(updated / 12), updated % 12); 752 763 }; 753 764 … … 756 767 /** 757 768 * @constructor 758 */ 759 function DaysTable() { 769 * @param {!CalendarPicker} picker 770 */ 771 function DaysTable(picker) { 772 this.picker = picker; 760 773 /** 761 774 * @type {!number} … … 791 804 792 805 /** 793 * @param {!Element} main794 */ 795 DaysTable.prototype.attachTo = function( main) {806 * @param {!Element} element 807 */ 808 DaysTable.prototype.attachTo = function(element) { 796 809 this._daysContainer = createElement("table", ClassNames.DaysArea); 797 810 this._daysContainer.addEventListener("click", bind(this._handleDayClick, this), false); … … 822 835 container.tabIndex = 0; 823 836 container.addEventListener("keydown", bind(this._handleKey, this), false); 824 main.appendChild(container);837 element.appendChild(container); 825 838 826 839 container.focus(); … … 831 844 * @return {!boolean} 832 845 */ 833 function stepMismatch(time) {834 return (time - global.minimumDate.getTime()) % global.step != 0;846 CalendarPicker.prototype.stepMismatch = function(time) { 847 return (time - this.minimumDate.getTime()) % this.step != 0; 835 848 } 836 849 … … 839 852 * @return {!boolean} 840 853 */ 841 function outOfRange(time) {842 return time < global.minimumDate.getTime() || time > global.maximumDate.getTime();854 CalendarPicker.prototype.outOfRange = function(time) { 855 return time < this.minimumDate.getTime() || time > this.maximumDate.getTime(); 843 856 } 844 857 … … 847 860 * @return {!boolean} 848 861 */ 849 function isValidDate(time) {850 return ! outOfRange(time) && !stepMismatch(time);862 CalendarPicker.prototype.isValidDate = function(time) { 863 return !this.outOfRange(time) && !this.stepMismatch(time); 851 864 } 852 865 … … 874 887 element.className = ClassNames.Day; 875 888 element.dataset.submitValue = serializeDate(iterYear, iterMonth, dayIterator.getUTCDate()); 876 if ( outOfRange(time))889 if (this.picker.outOfRange(time)) 877 890 element.classList.add(ClassNames.Unavailable); 878 else if ( stepMismatch(time))891 else if (this.picker.stepMismatch(time)) 879 892 element.classList.add(ClassNames.Unavailable); 880 893 else if ((iterYear == year && dayIterator.getUTCMonth() < month) || (month == 0 && iterMonth == 11)) { … … 893 906 } 894 907 895 global.today.disabled = !isValidDate(parseDateString().getTime());908 this.picker.today.disabled = !this.picker.isValidDate(parseDateString().getTime()); 896 909 }; 897 910 … … 901 914 */ 902 915 DaysTable.prototype._navigateToMonth = function(year, month) { 903 global.yearMonthController.setYearMonth(year, month);916 this.picker.yearMonthController.setYearMonth(year, month); 904 917 this._renderMonth(year, month); 905 918 }; … … 976 989 var month = global.yearMonthController.month(); 977 990 var thisMonthStartTime = createUTCDate(year, month, 1).getTime(); 978 if ( global.minimumDate.getTime() >= thisMonthStartTime)991 if (this.minimumDate.getTime() >= thisMonthStartTime) 979 992 return false; 980 993 if (month == 0) { … … 999 1012 month++; 1000 1013 var nextMonthStartTime = createUTCDate(year, month, 1).getTime(); 1001 if ( global.maximumDate.getTime() < nextMonthStartTime)1014 if (this.picker.maximumDate.getTime() < nextMonthStartTime) 1002 1015 return false; 1003 1016 this._navigateToMonthWithAnimation(year, month); … … 1010 1023 DaysTable.prototype._handleDayClick = function(event) { 1011 1024 if (event.target.classList.contains(ClassNames.Available)) 1012 submitValue(event.target.dataset.submitValue);1025 this.picker.submitValue(event.target.dataset.submitValue); 1013 1026 }; 1014 1027 … … 1111 1124 var dayNode = this._days[y][x]; 1112 1125 if (dayNode.classList.contains(ClassNames.Available)) { 1113 submitValue(dayNode.dataset.submitValue);1126 this.picker.submitValue(dayNode.dataset.submitValue); 1114 1127 event.stopPropagation(); 1115 1128 } … … 1140 1153 }; 1141 1154 1142 // ---------------------------------------------------------------- 1143 1144 function handleToday() { 1145 var date = new Date(); 1146 global.daysTable.selectDate(date); 1147 submitValue(serializeDate(date.getFullYear(), date.getMonth(), date.getDate())); 1148 } 1149 1150 function handleClear() { 1151 submitValue(""); 1152 } 1153 1154 /** 1155 * @param {string} value 1156 */ 1157 function submitValue(value) { 1158 window.pagePopupController.setValueAndClosePopup(0, value); 1159 } 1160 1161 function handleCancel() { 1162 window.pagePopupController.setValueAndClosePopup(-1, ""); 1163 } 1164 1165 /** 1166 * @param {Event} event 1167 */ 1168 function handleGlobalKey(event) { 1155 /** 1156 * @param {!Event} event 1157 */ 1158 CalendarPicker.prototype._handleBodyKeyDown = function(event) { 1169 1159 maybeUpdateFocusStyle(); 1170 1160 var key = event.keyIdentifier; … … 1173 1163 event.stopPropagation(); 1174 1164 event.preventDefault(); 1175 global.firstFocusableControl.focus();1165 this.firstFocusableControl.focus(); 1176 1166 } else if (event.shiftKey && document.activeElement == global.firstFocusableControl) { 1177 1167 event.stopPropagation(); 1178 1168 event.preventDefault(); 1179 global.lastFocusableControl.focus();1169 this.lastFocusableControl.focus(); 1180 1170 } 1181 1171 } else if (key == "U+004D") { // 'm' 1182 global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousMonth : YearMonthController.NextMonth);1172 this.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousMonth : YearMonthController.NextMonth); 1183 1173 } else if (key == "U+0059") { // 'y' 1184 global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousYear : YearMonthController.NextYear);1174 this.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousYear : YearMonthController.NextYear); 1185 1175 } else if (key == "U+0044") { // 'd' 1186 global.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousTenYears : YearMonthController.NextTenYears);1176 this.yearMonthController.moveRelatively(event.shiftKey ? YearMonthController.PreviousTenYears : YearMonthController.NextTenYears); 1187 1177 } else if (key == "U+001B") // ESC 1188 handleCancel();1178 this.handleCancel(); 1189 1179 } 1190 1180 -
trunk/Source/WebCore/Resources/pagepopups/colorSuggestionPicker.js
r125641 r127727 75 75 } 76 76 77 var Actions = {78 ChooseOtherColor: -2,79 Cancel: -1,80 SetValue: 081 };82 83 /**84 * @param {string} value85 */86 function submitValue(value) {87 window.pagePopupController.setValueAndClosePopup(Actions.SetValue, value);88 }89 90 function handleCancel() {91 window.pagePopupController.setValueAndClosePopup(Actions.Cancel, "");92 }93 94 function chooseOtherColor() {95 window.pagePopupController.setValueAndClosePopup(Actions.ChooseOtherColor, "");96 }97 98 77 function ColorPicker(element, config) { 99 this._element = element;78 Picker.call(this, element, config); 100 79 this._config = config; 101 80 if (this._config.values.length === 0) … … 107 86 this._element.addEventListener("mousedown", bind(this._handleMouseDown, this)); 108 87 } 88 ColorPicker.prototype = Object.create(Picker.prototype); 109 89 110 90 var SwatchBorderBoxWidth = 24; // keep in sync with CSS … … 131 111 this._element.appendChild(container); 132 112 var otherButton = createElement("button", "other-color", this._config.otherColorLabel); 133 otherButton.addEventListener("click", chooseOtherColor, false);113 otherButton.addEventListener("click", this.chooseOtherColor.bind(this), false); 134 114 this._element.appendChild(otherButton); 135 115 this._container = container; … … 159 139 var key = event.keyIdentifier; 160 140 if (key === "U+001B") // ESC 161 handleCancel();141 this.handleCancel(); 162 142 else if (key == "Left" || key == "Up" || key == "Right" || key == "Down") { 163 143 var selectedElement = document.activeElement; … … 195 175 ColorPicker.prototype._handleSwatchClick = function(event) { 196 176 if (event.target.classList.contains("color-swatch")) 197 submitValue(event.target.dataset.value);177 this.submitValue(event.target.dataset.value); 198 178 }; 199 179 -
trunk/Source/WebCore/Resources/pagepopups/pickerCommon.js
r125641 r127727 77 77 return window.scrollbarWidth; 78 78 } 79 80 /** 81 * @constructor 82 * @param {!Element} element 83 * @param {!Object} config 84 */ 85 function Picker(element, config) { 86 this._element = element; 87 this._config = config; 88 } 89 90 /** 91 * @enum {number} 92 */ 93 Picker.Actions = { 94 SetValue: 0, 95 Cancel: -1, 96 ChooseOtherColor: -2 97 }; 98 99 /** 100 * @param {!string} value 101 */ 102 Picker.prototype.submitValue = function(value) { 103 window.pagePopupController.setValueAndClosePopup(Picker.Actions.SetValue, value); 104 } 105 106 Picker.prototype.handleCancel = function() { 107 window.pagePopupController.setValueAndClosePopup(Picker.Actions.Cancel, ""); 108 } 109 110 Picker.prototype.chooseOtherColor = function() { 111 window.pagePopupController.setValueAndClosePopup(Picker.Actions.ChooseOtherColor, ""); 112 }
Note: See TracChangeset
for help on using the changeset viewer.