http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97957
Revision: 97957
Author: tparscal
Date: 2011-09-23 21:05:52 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Renamed things to not reduce confusion of the word "offset"
Modified Paths:
--------------
trunk/parsers/wikidom/lib/synth/es.Position.js
trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js
Modified: trunk/parsers/wikidom/lib/synth/es.Position.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/es.Position.js 2011-09-23 21:01:37 UTC
(rev 97956)
+++ trunk/parsers/wikidom/lib/synth/es.Position.js 2011-09-23 21:05:52 UTC
(rev 97957)
@@ -21,27 +21,27 @@
/* Static Methods */
/**
- * Creates position object from the offset of an element.
+ * Creates position object from the page position of an element.
*
* @static
* @method
* @param $element {jQuery} Element to get offset from
* @returns {es.Position} Position with element data applied
*/
-es.Position.newFromElementOffset = function( $element ) {
+es.Position.newFromElementPagePosition = function( $element ) {
var offset = $element.offset();
return new es.Position( offset.left, offset.top );
};
/**
- * Creates position object from the position of an element.
+ * Creates position object from the layer position of an element.
*
* @static
* @method
* @param $element {jQuery} Element to get position from
* @returns {es.Position} Position with element data applied
*/
-es.Position.newFromElementPosition = function( $element ) {
+es.Position.newFromElementLayerPosition = function( $element ) {
var position = $element.position();
return new es.Position( position.left, position.top );
};
Modified: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js 2011-09-23
21:01:37 UTC (rev 97956)
+++ trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js 2011-09-23
21:05:52 UTC (rev 97957)
@@ -255,6 +255,7 @@
es.SurfaceView.prototype.onMouseMove = function( e ) {
if (this.selecting ) {
var position = es.Position.newFromEventPagePosition( e );
+ position.subtract( es.Position.newFromElementPagePosition(
this.documentView.$ ) );
var offset = this.documentView.getOffsetFromPosition( position
);
this.to = offset;
this.documentView.drawSelection( new es.Range( this.from,
this.to ) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs