r97956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97955‎ | r97956 | r97957 >
Date:21:01, 23 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added newFromElementOffset and newFromElementPosition to es.Position
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/es.Position.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/es.Position.js
@@ -21,6 +21,32 @@
2222 /* Static Methods */
2323
2424 /**
 25+ * Creates position object from the offset of an element.
 26+ *
 27+ * @static
 28+ * @method
 29+ * @param $element {jQuery} Element to get offset from
 30+ * @returns {es.Position} Position with element data applied
 31+ */
 32+es.Position.newFromElementOffset = function( $element ) {
 33+ var offset = $element.offset();
 34+ return new es.Position( offset.left, offset.top );
 35+};
 36+
 37+/**
 38+ * Creates position object from the position of an element.
 39+ *
 40+ * @static
 41+ * @method
 42+ * @param $element {jQuery} Element to get position from
 43+ * @returns {es.Position} Position with element data applied
 44+ */
 45+es.Position.newFromElementPosition = function( $element ) {
 46+ var position = $element.position();
 47+ return new es.Position( position.left, position.top );
 48+};
 49+
 50+/**
2551 * Creates position object from the screen position data in an Event object.
2652 *
2753 * @static

Status & tagging log