Index: trunk/parsers/wikidom/lib/synth/es.Position.js |
— | — | @@ -21,27 +21,27 @@ |
22 | 22 | /* Static Methods */ |
23 | 23 | |
24 | 24 | /** |
25 | | - * Creates position object from the offset of an element. |
| 25 | + * Creates position object from the page position of an element. |
26 | 26 | * |
27 | 27 | * @static |
28 | 28 | * @method |
29 | 29 | * @param $element {jQuery} Element to get offset from |
30 | 30 | * @returns {es.Position} Position with element data applied |
31 | 31 | */ |
32 | | -es.Position.newFromElementOffset = function( $element ) { |
| 32 | +es.Position.newFromElementPagePosition = function( $element ) { |
33 | 33 | var offset = $element.offset(); |
34 | 34 | return new es.Position( offset.left, offset.top ); |
35 | 35 | }; |
36 | 36 | |
37 | 37 | /** |
38 | | - * Creates position object from the position of an element. |
| 38 | + * Creates position object from the layer position of an element. |
39 | 39 | * |
40 | 40 | * @static |
41 | 41 | * @method |
42 | 42 | * @param $element {jQuery} Element to get position from |
43 | 43 | * @returns {es.Position} Position with element data applied |
44 | 44 | */ |
45 | | -es.Position.newFromElementPosition = function( $element ) { |
| 45 | +es.Position.newFromElementLayerPosition = function( $element ) { |
46 | 46 | var position = $element.position(); |
47 | 47 | return new es.Position( position.left, position.top ); |
48 | 48 | }; |
Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js |
— | — | @@ -255,6 +255,7 @@ |
256 | 256 | es.SurfaceView.prototype.onMouseMove = function( e ) { |
257 | 257 | if (this.selecting ) { |
258 | 258 | var position = es.Position.newFromEventPagePosition( e ); |
| 259 | + position.subtract( es.Position.newFromElementPagePosition( this.documentView.$ ) ); |
259 | 260 | var offset = this.documentView.getOffsetFromPosition( position ); |
260 | 261 | this.to = offset; |
261 | 262 | this.documentView.drawSelection( new es.Range( this.from, this.to ) ); |