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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 this._enabled = enabled; | 182 this._enabled = enabled; |
183 } | 183 } |
184 | 184 |
185 /** | 185 /** |
186 * @param {!Event} event | 186 * @param {!Event} event |
187 */ | 187 */ |
188 _resizerElementStartDragging(event) { | 188 _resizerElementStartDragging(event) { |
189 if (!this._enabled) | 189 if (!this._enabled) |
190 return false; | 190 return false; |
191 this._resizerParentOffsetLeft = event.pageX - event.offsetX - event.target.o
ffsetLeft; | 191 this._resizerParentOffsetLeft = event.pageX - event.offsetX - event.target.o
ffsetLeft; |
192 event.preventDefault(); | 192 event.stopPropagation(); |
193 return true; | 193 return true; |
194 } | 194 } |
195 | 195 |
196 /** | 196 /** |
197 * @param {!Event} event | 197 * @param {!Event} event |
198 */ | 198 */ |
199 _leftResizeElementDragging(event) { | 199 _leftResizeElementDragging(event) { |
200 this._resizeWindowLeft(event.pageX - this._resizerParentOffsetLeft); | 200 this._resizeWindowLeft(event.pageX - this._resizerParentOffsetLeft); |
201 event.preventDefault(); | 201 event.preventDefault(); |
202 } | 202 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 position = Math.max(0, Math.min(position, this._width)); | 432 position = Math.max(0, Math.min(position, this._width)); |
433 if (position < this._startPosition) { | 433 if (position < this._startPosition) { |
434 this._windowSelector.style.left = position + 'px'; | 434 this._windowSelector.style.left = position + 'px'; |
435 this._windowSelector.style.right = this._width - this._startPosition + 'px
'; | 435 this._windowSelector.style.right = this._width - this._startPosition + 'px
'; |
436 } else { | 436 } else { |
437 this._windowSelector.style.left = this._startPosition + 'px'; | 437 this._windowSelector.style.left = this._startPosition + 'px'; |
438 this._windowSelector.style.right = this._width - position + 'px'; | 438 this._windowSelector.style.right = this._width - position + 'px'; |
439 } | 439 } |
440 } | 440 } |
441 }; | 441 }; |
OLD | NEW |