mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Coords constructor documentation
This commit is contained in:
@@ -8,10 +8,16 @@
|
|||||||
|
|
||||||
;(function($, window, document, undefined){
|
;(function($, window, document, undefined){
|
||||||
/**
|
/**
|
||||||
* Coords
|
|
||||||
*
|
|
||||||
* @class 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
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function Coords(obj) {
|
function Coords(obj) {
|
||||||
@@ -27,8 +33,10 @@
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var fn = Coords.prototype;
|
var fn = Coords.prototype;
|
||||||
|
|
||||||
|
|
||||||
fn.init = function(){
|
fn.init = function(){
|
||||||
this.set();
|
this.set();
|
||||||
this.original_coords = this.get();
|
this.original_coords = this.get();
|
||||||
@@ -86,6 +94,7 @@
|
|||||||
return this.coords;
|
return this.coords;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//jQuery adapter
|
//jQuery adapter
|
||||||
$.fn.coords = function() {
|
$.fn.coords = function() {
|
||||||
if (this.data('coords') ) {
|
if (this.data('coords') ) {
|
||||||
|
Reference in New Issue
Block a user