Coords constructor documentation

This commit is contained in:
vieron
2012-07-23 21:50:15 +02:00
parent 7ae385ea05
commit 7e8ce8dd0a

View File

@@ -8,10 +8,16 @@
;(function($, window, document, undefined){
/**
* Coords
*
* @class Coords
* @param {HTMLElement|Object} obj HTMLElement or a literal Object with the left, top, width and height properties.
*
* Creates objects with coordinates (x1, y1, x2, y2, cx, cy, width, height)
* to simulate DOM elements on the screen.
* Coords is used by Gridster to create a faux grid with any DOM element can
* collide.
*
* @param {HTMLElement|Object} obj The jQuery HTMLElement or a object with: left,
* top, width and height properties.
* @return {Object} Coords instance.
* @constructor
*/
function Coords(obj) {
@@ -27,8 +33,10 @@
return this;
}
var fn = Coords.prototype;
fn.init = function(){
this.set();
this.original_coords = this.get();
@@ -86,6 +94,7 @@
return this.coords;
};
//jQuery adapter
$.fn.coords = function() {
if (this.data('coords') ) {