Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add type annotations to offset methods

  • Loading branch information...
commit 8ef42c72f1cdfb7f48f5812a6c04ee80deabeb17 1 parent b23a09e
Chad Killingsworth authored April 09, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  src/offset.js
6  src/offset.js
@@ -172,6 +172,7 @@ jQuery.offset = {
172 172
 
173 173
 jQuery.fn.extend({
174 174
 
  175
+	/** @return {?{left:number,top:number}} */
175 176
 	position: function() {
176 177
 		if ( !this[0] ) {
177 178
 			return null;
@@ -203,6 +204,7 @@ jQuery.fn.extend({
203 204
 		};
204 205
 	},
205 206
 
  207
+	/** @return {!jQuery} */
206 208
 	offsetParent: function() {
207 209
 		return this.map(function() {
208 210
 			var offsetParent = this.offsetParent || document.body;
@@ -219,6 +221,10 @@ jQuery.fn.extend({
219 221
 jQuery.expandedEach( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
220 222
 	var top = /Y/.test( prop );
221 223
 
  224
+	/**
  225
+	 * @param {number=} val
  226
+	 * @return {(number|!jQuery)}
  227
+	 */
222 228
 	jQuery.fn[ method ] = function( val ) {
223 229
 		return jQuery.access( this, function( elem, method, val ) {
224 230
 			var win = getWindow( elem );

0 notes on commit 8ef42c7

Please sign in to comment.
Something went wrong with that request. Please try again.