OLD | NEW |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 if (window.frameElement) { | 157 if (window.frameElement) { |
158 window.frameElement.style.width = rect.width + "px"; | 158 window.frameElement.style.width = rect.width + "px"; |
159 window.frameElement.style.height = rect.height + "px"; | 159 window.frameElement.style.height = rect.height + "px"; |
160 } else { | 160 } else { |
161 window.moveTo(rect.x - window.screen.availLeft, rect.y - window.screen.a
vailTop); | 161 window.moveTo(rect.x - window.screen.availLeft, rect.y - window.screen.a
vailTop); |
162 window.resizeTo(rect.width, rect.height); | 162 window.resizeTo(rect.width, rect.height); |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 function hideWindow() { | 166 function hideWindow() { |
167 setWindowRect(new Rect(0, 0, 1, 1)); | 167 resizeWindow(1, 1); |
168 } | 168 } |
169 | 169 |
170 window.addEventListener("resize", function() { | 170 window.addEventListener("resize", function() { |
171 if (window.innerWidth === 1 && window.innerHeight === 1) | 171 if (window.innerWidth === 1 && window.innerHeight === 1) |
172 window.dispatchEvent(new CustomEvent("didHide")); | 172 window.dispatchEvent(new CustomEvent("didHide")); |
173 else | 173 else |
174 window.dispatchEvent(new CustomEvent("didOpenPicker")); | 174 window.dispatchEvent(new CustomEvent("didOpenPicker")); |
175 }, false); | 175 }, false); |
176 | 176 |
177 /** | 177 /** |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 Picker.prototype.handleCancel = function() { | 233 Picker.prototype.handleCancel = function() { |
234 window.pagePopupController.setValueAndClosePopup(Picker.Actions.Cancel, ""); | 234 window.pagePopupController.setValueAndClosePopup(Picker.Actions.Cancel, ""); |
235 } | 235 } |
236 | 236 |
237 Picker.prototype.chooseOtherColor = function() { | 237 Picker.prototype.chooseOtherColor = function() { |
238 window.pagePopupController.setValueAndClosePopup(Picker.Actions.ChooseOtherC
olor, ""); | 238 window.pagePopupController.setValueAndClosePopup(Picker.Actions.ChooseOtherC
olor, ""); |
239 } | 239 } |
240 | 240 |
241 Picker.prototype.cleanup = function() {}; | 241 Picker.prototype.cleanup = function() {}; |
OLD | NEW |