OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 }, | 194 }, |
195 | 195 |
196 /** | 196 /** |
197 * @param {!Event} event | 197 * @param {!Event} event |
198 */ | 198 */ |
199 _resizerElementStartDragging: function(event) | 199 _resizerElementStartDragging: function(event) |
200 { | 200 { |
201 if (!this._enabled) | 201 if (!this._enabled) |
202 return false; | 202 return false; |
203 this._resizerParentOffsetLeft = event.pageX - event.offsetX - event.targ
et.offsetLeft; | 203 this._resizerParentOffsetLeft = event.pageX - event.offsetX - event.targ
et.offsetLeft; |
204 event.stopPropagation(); | 204 event.preventDefault(); |
205 return true; | 205 return true; |
206 }, | 206 }, |
207 | 207 |
208 /** | 208 /** |
209 * @param {!Event} event | 209 * @param {!Event} event |
210 */ | 210 */ |
211 _leftResizeElementDragging: function(event) | 211 _leftResizeElementDragging: function(event) |
212 { | 212 { |
213 this._resizeWindowLeft(event.pageX - this._resizerParentOffsetLeft); | 213 this._resizeWindowLeft(event.pageX - this._resizerParentOffsetLeft); |
214 event.preventDefault(); | 214 event.preventDefault(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 position = Math.max(0, Math.min(position, this._width)); | 457 position = Math.max(0, Math.min(position, this._width)); |
458 if (position < this._startPosition) { | 458 if (position < this._startPosition) { |
459 this._windowSelector.style.left = position + "px"; | 459 this._windowSelector.style.left = position + "px"; |
460 this._windowSelector.style.right = this._width - this._startPosition
+ "px"; | 460 this._windowSelector.style.right = this._width - this._startPosition
+ "px"; |
461 } else { | 461 } else { |
462 this._windowSelector.style.left = this._startPosition + "px"; | 462 this._windowSelector.style.left = this._startPosition + "px"; |
463 this._windowSelector.style.right = this._width - position + "px"; | 463 this._windowSelector.style.right = this._width - position + "px"; |
464 } | 464 } |
465 } | 465 } |
466 }; | 466 }; |
OLD | NEW |