mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updated docs and dist
This commit is contained in:
2
dist/jquery.gridster.css
vendored
2
dist/jquery.gridster.css
vendored
@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.1.0 - 2012-07-18
|
||||
/*! gridster.js - v0.1.0 - 2012-07-19
|
||||
* https://github.com/ducksboard/gridster.js
|
||||
* Copyright (c) 2012 ducksboard; Licensed MIT, GPL */
|
||||
|
||||
|
74
dist/jquery.gridster.js
vendored
74
dist/jquery.gridster.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.1.0 - 2012-07-18
|
||||
/*! gridster.js - v0.1.0 - 2012-07-19
|
||||
* https://github.com/ducksboard/gridster.js
|
||||
* Copyright (c) 2012 ducksboard; Licensed MIT, GPL */
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
this.original_coords = this.get();
|
||||
};
|
||||
|
||||
fn.set = function(update) {
|
||||
fn.set = function() {
|
||||
var el = this.el;
|
||||
if (el) {
|
||||
this.data = el.offset();
|
||||
@ -62,7 +62,7 @@
|
||||
var new_data = $.extend(this.data, data);
|
||||
this.data = new_data;
|
||||
}
|
||||
this.set(true);
|
||||
this.set();
|
||||
return this;
|
||||
};
|
||||
|
||||
@ -300,12 +300,8 @@
|
||||
row: wgd.row
|
||||
};
|
||||
},
|
||||
collision: {
|
||||
on_overlap: function(coords) {}
|
||||
},
|
||||
draggable: {
|
||||
|
||||
}
|
||||
collision: {},
|
||||
draggable: {}
|
||||
};
|
||||
|
||||
|
||||
@ -356,14 +352,14 @@
|
||||
* @param {HTMLElement} el The HTMLelement that contains all the widgets.
|
||||
* @param {Object} [options] An Object with all options you want to
|
||||
* overwrite:
|
||||
* @param {HTMLElement|String} [options.widget_selector] Define who will be the
|
||||
* draggable widgets. Can be a CSS Selector String or a collection of
|
||||
* HTMLElements
|
||||
* @param {Array} [options.widget_margins] Margin between widgets. The first
|
||||
* index for the horizontal margin (left, right) and the second
|
||||
* for the vertical margin (top, bottom).
|
||||
* @param {Array} [options.widget_base_dimensions] Base widget dimensions in
|
||||
* pixels. The first index for the width and the second for the
|
||||
* @param {HTMLElement|String} [options.widget_selector] Define who will
|
||||
* be the draggable widgets. Can be a CSS Selector String or a
|
||||
* collection of HTMLElements
|
||||
* @param {Array} [options.widget_margins] Margin between widgets.
|
||||
* The first index for the horizontal margin (left, right) and
|
||||
* the second for the vertical margin (top, bottom).
|
||||
* @param {Array} [options.widget_base_dimensions] Base widget dimensions
|
||||
* in pixels. The first index for the width and the second for the
|
||||
* height.
|
||||
* @param {Number} [options.extra_cols] Add more columns in addition to
|
||||
* those that have been calculated.
|
||||
@ -413,6 +409,9 @@
|
||||
this.set_dom_grid_height();
|
||||
this.$wrapper.addClass('ready');
|
||||
this.draggable();
|
||||
|
||||
$(window).bind(
|
||||
'resize', throttle($.proxy(this.recalculate_faux_grid, this), 200));
|
||||
};
|
||||
|
||||
|
||||
@ -2142,7 +2141,6 @@
|
||||
this.gridmap = [];
|
||||
var col;
|
||||
var row;
|
||||
|
||||
for (col = cols; col > 0; col--) {
|
||||
this.gridmap[col] = [];
|
||||
for (row = rows; row > 0; row--) {
|
||||
@ -2164,6 +2162,31 @@
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Recalculates the offsets for the faux grid. You need to use it when
|
||||
* the browser is resized.
|
||||
*
|
||||
* @method recalculate_faux_grid
|
||||
* @return {Object} Returns the instance of the Gridster class.
|
||||
*/
|
||||
fn.recalculate_faux_grid = function() {
|
||||
var aw = this.$wrapper.width();
|
||||
this.baseX = ($(window).width() - aw) / 2;
|
||||
this.baseY = this.$wrapper.offset().top;
|
||||
|
||||
$.each(this.faux_grid, $.proxy(function(i, coords){
|
||||
this.faux_grid[i] = coords.update({
|
||||
left: this.baseX + (coords.data.col -1) * this.min_widget_width,
|
||||
top: this.baseY + (coords.data.row -1) * this.min_widget_height
|
||||
});
|
||||
|
||||
}, this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get all widgets in the DOM and register them.
|
||||
*
|
||||
@ -2186,13 +2209,12 @@
|
||||
* @return {Object} Returns the instance of the Gridster class.
|
||||
*/
|
||||
fn.generate_grid_and_stylesheet = function() {
|
||||
var grid_width;
|
||||
var aw = this.$wrapper.width();
|
||||
var ah = this.$wrapper.height();
|
||||
|
||||
var cols = Math.floor(aw/this.min_widget_width) +
|
||||
var cols = Math.floor(aw / this.min_widget_width) +
|
||||
this.options.extra_cols;
|
||||
var rows = Math.floor(ah/this.min_widget_height) +
|
||||
var rows = Math.floor(ah / this.min_widget_height) +
|
||||
this.options.extra_rows;
|
||||
|
||||
var actual_cols = this.$widgets.map(function() {
|
||||
@ -2208,18 +2230,16 @@
|
||||
|
||||
cols = Math.max(min_cols, cols, this.options.min_cols);
|
||||
rows = Math.max(min_rows, rows, this.options.min_rows);
|
||||
grid_width = cols * (this.options.widget_base_dimensions[0] +
|
||||
(this.options.widget_margins[0] * 2));
|
||||
|
||||
//this.support_grid_width = cols * this.min_widget_width;
|
||||
this.support_grid_width = this.wrapper_width;
|
||||
// this.support_grid_width = this.wrapper_width;
|
||||
|
||||
this.support_grid_height = rows * this.min_widget_height;
|
||||
this.baseX = ($(window).width() - this.support_grid_width) / 2;
|
||||
// this.support_grid_height = rows * this.min_widget_height;
|
||||
this.baseX = ($(window).width() - aw) / 2;
|
||||
this.baseY = this.$wrapper.offset().top;
|
||||
|
||||
//this.baseX = 0;
|
||||
if(this.options.autogenerate_stylesheet) {
|
||||
if (this.options.autogenerate_stylesheet) {
|
||||
this.generate_stylesheet(rows, cols);
|
||||
}
|
||||
|
||||
|
2
dist/jquery.gridster.min.css
vendored
2
dist/jquery.gridster.min.css
vendored
@ -1,3 +1,3 @@
|
||||
/*! gridster.js - v0.1.0 - 2012-07-18
|
||||
/*! gridster.js - v0.1.0 - 2012-07-19
|
||||
* https://github.com/ducksboard/gridster.js
|
||||
* Copyright (c) 2012 ducksboard; Licensed MIT, GPL */.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute;background:rgba(0,0,0,.23)}.ready .gs_w:not(.player):not(.preview-holder):not(.ui-draggable-dragging){-webkit-transition:left .3s,top .3s;-moz-transition:left .3s,top .3s;-o-transition:left .3s,top .3s}.gridster.dragging .ui-sortable-helper{z-index:9}.gridster .preview-holder{border:2px dashed #333;border-radius:5px;z-index:1;background:#FFF;position:absolute}.gridster .ui-draggable-dragging{z-index:10!important}
|
4
dist/jquery.gridster.min.js
vendored
4
dist/jquery.gridster.min.js
vendored
File diff suppressed because one or more lines are too long
@ -106,7 +106,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_jquery.gridster.js.html#l73"><code>src/jquery.gridster.js:73</code></a>
|
||||
Defined in: <a href="../files/src_jquery.gridster.js.html#l70"><code>src/jquery.gridster.js:70</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l73"><code>src/jquery.gridster.js:73</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l70"><code>src/jquery.gridster.js:70</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -232,9 +232,9 @@
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>Define who will be the
|
||||
draggable widgets. Can be a CSS Selector String or a collection of
|
||||
HTMLElements</p>
|
||||
<p>Define who will
|
||||
be the draggable widgets. Can be a CSS Selector String or a
|
||||
collection of HTMLElements</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -248,9 +248,9 @@
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>Margin between widgets. The first
|
||||
index for the horizontal margin (left, right) and the second
|
||||
for the vertical margin (top, bottom).</p>
|
||||
<p>Margin between widgets.
|
||||
The first index for the horizontal margin (left, right) and
|
||||
the second for the vertical margin (top, bottom).</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -264,8 +264,8 @@
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>Base widget dimensions in
|
||||
pixels. The first index for the width and the second for the
|
||||
<p>Base widget dimensions
|
||||
in pixels. The first index for the width and the second for the
|
||||
height.</p>
|
||||
</div>
|
||||
|
||||
@ -756,6 +756,13 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
<a href="#method_recalculate_faux_grid">recalculate_faux_grid</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
@ -918,7 +925,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1818"><code>src/jquery.gridster.js:1818</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1829"><code>src/jquery.gridster.js:1829</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1028,7 +1035,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l292"><code>src/jquery.gridster.js:292</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l293"><code>src/jquery.gridster.js:293</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1296,7 +1303,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l915"><code>src/jquery.gridster.js:915</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l925"><code>src/jquery.gridster.js:925</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1414,7 +1421,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1321"><code>src/jquery.gridster.js:1321</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1332"><code>src/jquery.gridster.js:1332</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1551,7 +1558,7 @@ upper row possible.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l963"><code>src/jquery.gridster.js:963</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l974"><code>src/jquery.gridster.js:974</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1669,7 +1676,7 @@ upper row possible.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1493"><code>src/jquery.gridster.js:1493</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1504"><code>src/jquery.gridster.js:1504</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1796,7 +1803,7 @@ into account the dimensions (<code>size_y</code> and <code>size_x</code> attrs.
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l314"><code>src/jquery.gridster.js:314</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l315"><code>src/jquery.gridster.js:315</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1867,7 +1874,7 @@ into account the dimensions (<code>size_y</code> and <code>size_x</code> attrs.
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1456"><code>src/jquery.gridster.js:1456</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1467"><code>src/jquery.gridster.js:1467</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -1954,7 +1961,7 @@ into account the dimensions (<code>size_y</code> and <code>size_x</code> attrs.
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1591"><code>src/jquery.gridster.js:1591</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1602"><code>src/jquery.gridster.js:1602</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2082,7 +2089,7 @@ each one.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1612"><code>src/jquery.gridster.js:1612</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1623"><code>src/jquery.gridster.js:1623</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2210,7 +2217,7 @@ each one.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1631"><code>src/jquery.gridster.js:1631</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1642"><code>src/jquery.gridster.js:1642</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2343,7 +2350,7 @@ each one.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1697"><code>src/jquery.gridster.js:1697</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1708"><code>src/jquery.gridster.js:1708</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2490,7 +2497,7 @@ iteration. The value of <code>this</code> inside the function is the jQuery wrap
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1713"><code>src/jquery.gridster.js:1713</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1724"><code>src/jquery.gridster.js:1724</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2631,7 +2638,7 @@ iteration. The value of <code>this</code> inside the function is the jQuery wrap
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1841"><code>src/jquery.gridster.js:1841</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1852"><code>src/jquery.gridster.js:1852</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2741,7 +2748,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1891"><code>src/jquery.gridster.js:1891</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1926"><code>src/jquery.gridster.js:1926</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2829,7 +2836,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1774"><code>src/jquery.gridster.js:1774</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1785"><code>src/jquery.gridster.js:1785</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -2948,7 +2955,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1563"><code>src/jquery.gridster.js:1563</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1574"><code>src/jquery.gridster.js:1574</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3042,7 +3049,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1729"><code>src/jquery.gridster.js:1729</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1740"><code>src/jquery.gridster.js:1740</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3123,7 +3130,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1528"><code>src/jquery.gridster.js:1528</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1539"><code>src/jquery.gridster.js:1539</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3228,7 +3235,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1546"><code>src/jquery.gridster.js:1546</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1557"><code>src/jquery.gridster.js:1557</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3345,7 +3352,7 @@ detect row or column that we want to go.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1014"><code>src/jquery.gridster.js:1014</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1025"><code>src/jquery.gridster.js:1025</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3473,7 +3480,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1877"><code>src/jquery.gridster.js:1877</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1912"><code>src/jquery.gridster.js:1912</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3544,7 +3551,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1092"><code>src/jquery.gridster.js:1092</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1103"><code>src/jquery.gridster.js:1103</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3615,7 +3622,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l852"><code>src/jquery.gridster.js:852</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l861"><code>src/jquery.gridster.js:861</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3702,7 +3709,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l771"><code>src/jquery.gridster.js:771</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l780"><code>src/jquery.gridster.js:780</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3827,7 +3834,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l790"><code>src/jquery.gridster.js:790</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l799"><code>src/jquery.gridster.js:799</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -3952,7 +3959,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l745"><code>src/jquery.gridster.js:745</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l754"><code>src/jquery.gridster.js:754</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4071,7 +4078,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l759"><code>src/jquery.gridster.js:759</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l768"><code>src/jquery.gridster.js:768</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4181,7 +4188,7 @@ the</code>upper<em>rows<code>array. Iteration starts from row specified in</code
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l713"><code>src/jquery.gridster.js:713</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l722"><code>src/jquery.gridster.js:722</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4309,7 +4316,7 @@ HTMLElements.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l730"><code>src/jquery.gridster.js:730</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l739"><code>src/jquery.gridster.js:739</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4435,7 +4442,7 @@ and col given.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l810"><code>src/jquery.gridster.js:810</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l819"><code>src/jquery.gridster.js:819</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4561,7 +4568,7 @@ else returns the jQuery HTMLElement
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l835"><code>src/jquery.gridster.js:835</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l844"><code>src/jquery.gridster.js:844</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4693,7 +4700,7 @@ params and if this is under the widget that is being dragged.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l668"><code>src/jquery.gridster.js:668</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l676"><code>src/jquery.gridster.js:676</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4704,7 +4711,8 @@ params and if this is under the widget that is being dragged.</p>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.</p>
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of
|
||||
each widget) in descending way.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -4834,7 +4842,7 @@ params and if this is under the widget that is being dragged.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1276"><code>src/jquery.gridster.js:1276</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1287"><code>src/jquery.gridster.js:1287</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -4953,7 +4961,7 @@ params and if this is under the widget that is being dragged.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1187"><code>src/jquery.gridster.js:1187</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1198"><code>src/jquery.gridster.js:1198</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5065,7 +5073,7 @@ if they can.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1230"><code>src/jquery.gridster.js:1230</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1241"><code>src/jquery.gridster.js:1241</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5187,7 +5195,7 @@ if they can.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l389"><code>src/jquery.gridster.js:389</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l395"><code>src/jquery.gridster.js:395</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5300,7 +5308,7 @@ if they can.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l466"><code>src/jquery.gridster.js:466</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l472"><code>src/jquery.gridster.js:472</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5428,7 +5436,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l506"><code>src/jquery.gridster.js:506</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l512"><code>src/jquery.gridster.js:512</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5552,7 +5560,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l342"><code>src/jquery.gridster.js:342</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l346"><code>src/jquery.gridster.js:346</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5659,7 +5667,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1125"><code>src/jquery.gridster.js:1125</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1136"><code>src/jquery.gridster.js:1136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5763,7 +5771,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1137"><code>src/jquery.gridster.js:1137</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1148"><code>src/jquery.gridster.js:1148</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5869,7 +5877,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l415"><code>src/jquery.gridster.js:415</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l421"><code>src/jquery.gridster.js:421</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -5976,7 +5984,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1149"><code>src/jquery.gridster.js:1149</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1160"><code>src/jquery.gridster.js:1160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6080,7 +6088,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1167"><code>src/jquery.gridster.js:1167</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1178"><code>src/jquery.gridster.js:1178</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6135,6 +6143,78 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_recalculate_faux_grid" class="method item">
|
||||
<h3 class="name"><code>recalculate_faux_grid</code></h3>
|
||||
|
||||
|
||||
<span class="paren">()</span>
|
||||
|
||||
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type">Object</span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1888"><code>src/jquery.gridster.js:1888</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Recalculates the offsets for the faux grid. You need to use it when
|
||||
the browser is resized.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
|
||||
|
||||
<span class="type">Object</span>:
|
||||
|
||||
Returns the instance of the Gridster class.
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -6185,7 +6265,8 @@ overlapped or stops being overlapped.</p>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Creates the grid coords object representing the widget a add it to the mapped array of positions</p>
|
||||
<p>Creates the grid coords object representing the widget a add it to the
|
||||
mapped array of positions.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -6255,7 +6336,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l279"><code>src/jquery.gridster.js:279</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l280"><code>src/jquery.gridster.js:280</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6650,7 +6731,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1439"><code>src/jquery.gridster.js:1439</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1450"><code>src/jquery.gridster.js:1450</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6759,7 +6840,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1761"><code>src/jquery.gridster.js:1761</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1772"><code>src/jquery.gridster.js:1772</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6846,7 +6927,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l874"><code>src/jquery.gridster.js:874</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l883"><code>src/jquery.gridster.js:883</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -6973,7 +7054,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l542"><code>src/jquery.gridster.js:542</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l548"><code>src/jquery.gridster.js:548</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -7094,7 +7175,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l631"><code>src/jquery.gridster.js:631</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l637"><code>src/jquery.gridster.js:637</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -7105,7 +7186,8 @@ overlapped or stops being overlapped.</p>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of each widget) in ascending way.</p>
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of
|
||||
each widget) in ascending way.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -7198,7 +7280,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l650"><code>src/jquery.gridster.js:650</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l657"><code>src/jquery.gridster.js:657</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -7209,7 +7291,8 @@ overlapped or stops being overlapped.</p>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.</p>
|
||||
<p>Sorts an Array of grid coords objects (representing the grid coords of
|
||||
each widget) in descending way.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -7308,7 +7391,7 @@ overlapped or stops being overlapped.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l258"><code>src/jquery.gridster.js:258</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l259"><code>src/jquery.gridster.js:259</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -7431,7 +7514,7 @@ the grid coords object passed in the <code>grid_data</code> param.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l1410"><code>src/jquery.gridster.js:1410</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l1421"><code>src/jquery.gridster.js:1421</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
@ -7535,7 +7618,7 @@ the grid coords object passed in the <code>grid_data</code> param.</p>
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_jquery.gridster.js.html#l595"><code>src/jquery.gridster.js:595</code></a>
|
||||
<a href="../files/src_jquery.gridster.js.html#l601"><code>src/jquery.gridster.js:601</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
138
docs/data.json
138
docs/data.json
@ -123,7 +123,7 @@
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 73,
|
||||
"line": 70,
|
||||
"uses": [
|
||||
"Coords",
|
||||
"Collision"
|
||||
@ -142,19 +142,19 @@
|
||||
"props": [
|
||||
{
|
||||
"name": "widget_selector",
|
||||
"description": "Define who will be the\n draggable widgets. Can be a CSS Selector String or a collection of\n HTMLElements",
|
||||
"description": "Define who will\n be the draggable widgets. Can be a CSS Selector String or a\n collection of HTMLElements",
|
||||
"type": "HTMLElement|String",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "widget_margins",
|
||||
"description": "Margin between widgets. The first\n index for the horizontal margin (left, right) and the second\n for the vertical margin (top, bottom).",
|
||||
"description": "Margin between widgets.\n The first index for the horizontal margin (left, right) and\n the second for the vertical margin (top, bottom).",
|
||||
"type": "Array",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "widget_base_dimensions",
|
||||
"description": "Base widget dimensions in\n pixels. The first index for the width and the second for the\n height.",
|
||||
"description": "Base widget dimensions\n in pixels. The first index for the width and the second for the\n height.",
|
||||
"type": "Array",
|
||||
"optional": true
|
||||
},
|
||||
@ -296,7 +296,7 @@
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 231,
|
||||
"description": "Creates the grid coords object representing the widget a add it to the mapped array of positions",
|
||||
"description": "Creates the grid coords object representing the widget a add it to the\nmapped array of positions.",
|
||||
"itemtype": "method",
|
||||
"name": "register_widget",
|
||||
"return": {
|
||||
@ -307,7 +307,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 258,
|
||||
"line": 259,
|
||||
"description": "Update in the mapped array of positions the value of cells represented by\nthe grid coords object passed in the `grid_data` param.",
|
||||
"params": [
|
||||
{
|
||||
@ -331,7 +331,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 279,
|
||||
"line": 280,
|
||||
"description": "Remove a widget from the mapped array of positions.",
|
||||
"itemtype": "method",
|
||||
"name": "remove_from_gridmap",
|
||||
@ -350,7 +350,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 292,
|
||||
"line": 293,
|
||||
"description": "Add a widget to the mapped array of positions.",
|
||||
"itemtype": "method",
|
||||
"name": "add_to_gridmap",
|
||||
@ -374,7 +374,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 314,
|
||||
"line": 315,
|
||||
"description": "Make widgets draggable. It Wraps the jQuery UI Draggable Plugin.",
|
||||
"itemtype": "method",
|
||||
"name": "draggable",
|
||||
@ -386,7 +386,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 342,
|
||||
"line": 346,
|
||||
"description": "This function is executed when the player begins to be dragged.",
|
||||
"itemtype": "method",
|
||||
"name": "on_start_drag",
|
||||
@ -406,7 +406,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 389,
|
||||
"line": 395,
|
||||
"description": "This function is executed when the player is being dragged.",
|
||||
"itemtype": "method",
|
||||
"name": "on_drag",
|
||||
@ -426,7 +426,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 415,
|
||||
"line": 421,
|
||||
"description": "This function is executed when the player stops being dragged.",
|
||||
"itemtype": "method",
|
||||
"name": "on_stop_drag",
|
||||
@ -446,7 +446,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 466,
|
||||
"line": 472,
|
||||
"description": "Executes the callbacks passed as arguments when a column begins to be\noverlapped or stops being overlapped.",
|
||||
"params": [
|
||||
{
|
||||
@ -470,7 +470,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 506,
|
||||
"line": 512,
|
||||
"description": "Executes the callbacks passed as arguments when a row starts to be\noverlapped or stops being overlapped.",
|
||||
"params": [
|
||||
{
|
||||
@ -494,7 +494,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 542,
|
||||
"line": 548,
|
||||
"description": "Sets the current position of the player",
|
||||
"params": [
|
||||
{
|
||||
@ -518,7 +518,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 595,
|
||||
"line": 601,
|
||||
"description": "See which of the widgets in the $widgets param collection can go to\na upper row and which not.",
|
||||
"itemtype": "method",
|
||||
"name": "widgets_contraints",
|
||||
@ -537,8 +537,8 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 631,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of each widget) in ascending way.",
|
||||
"line": 637,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of\neach widget) in ascending way.",
|
||||
"itemtype": "method",
|
||||
"name": "sort_by_row_asc",
|
||||
"params": [
|
||||
@ -556,8 +556,8 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 650,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.",
|
||||
"line": 657,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of\neach widget) in descending way.",
|
||||
"itemtype": "method",
|
||||
"name": "sort_by_row_desc",
|
||||
"params": [
|
||||
@ -575,8 +575,8 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 668,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.",
|
||||
"line": 676,
|
||||
"description": "Sorts an Array of grid coords objects (representing the grid coords of\neach widget) in descending way.",
|
||||
"itemtype": "method",
|
||||
"name": "manage_movements",
|
||||
"params": [
|
||||
@ -604,7 +604,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 713,
|
||||
"line": 722,
|
||||
"description": "Determines if there is a widget in the row and col given. Or if the\nHTMLElement passed as first argument is the player.",
|
||||
"itemtype": "method",
|
||||
"name": "is_player",
|
||||
@ -629,7 +629,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 730,
|
||||
"line": 739,
|
||||
"description": "Determines if the widget that is being dragged is currently over the row\nand col given.",
|
||||
"itemtype": "method",
|
||||
"name": "is_player_in",
|
||||
@ -653,7 +653,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 745,
|
||||
"line": 754,
|
||||
"description": "Determines if the placeholder is currently over the row and col given.",
|
||||
"itemtype": "method",
|
||||
"name": "is_placeholder_in",
|
||||
@ -677,7 +677,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 759,
|
||||
"line": 768,
|
||||
"description": "Determines if the placeholder is currently over the column given.",
|
||||
"itemtype": "method",
|
||||
"name": "is_placeholder_in_col",
|
||||
@ -696,7 +696,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 771,
|
||||
"line": 780,
|
||||
"description": "Determines if the cell represented by col and row params is empty.",
|
||||
"itemtype": "method",
|
||||
"name": "is_empty",
|
||||
@ -720,7 +720,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 790,
|
||||
"line": 799,
|
||||
"description": "Determines if the cell represented by col and row params is occupied.",
|
||||
"itemtype": "method",
|
||||
"name": "is_occupied",
|
||||
@ -744,7 +744,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 810,
|
||||
"line": 819,
|
||||
"description": "Determines if there is a widget in the cell represented by col/row params.",
|
||||
"itemtype": "method",
|
||||
"name": "is_widget",
|
||||
@ -768,7 +768,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 835,
|
||||
"line": 844,
|
||||
"description": "Determines if there is a widget in the cell represented by col/row\nparams and if this is under the widget that is being dragged.",
|
||||
"itemtype": "method",
|
||||
"name": "is_widget_under_player",
|
||||
@ -792,7 +792,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 852,
|
||||
"line": 861,
|
||||
"description": "Get widgets overlapping with the player.",
|
||||
"itemtype": "method",
|
||||
"name": "get_widgets_under_player",
|
||||
@ -804,7 +804,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 874,
|
||||
"line": 883,
|
||||
"description": "Put placeholder at the row and column specified.",
|
||||
"itemtype": "method",
|
||||
"name": "set_placeholder",
|
||||
@ -828,7 +828,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 915,
|
||||
"line": 925,
|
||||
"description": "Determines whether the player can move to a position above.",
|
||||
"itemtype": "method",
|
||||
"name": "can_go_player_up",
|
||||
@ -847,7 +847,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 963,
|
||||
"line": 974,
|
||||
"description": "Determines whether a widget can move to a position above.",
|
||||
"itemtype": "method",
|
||||
"name": "can_go_widget_up",
|
||||
@ -866,7 +866,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1014,
|
||||
"line": 1025,
|
||||
"description": "Search a valid row for the widget represented by `widget_grid_data' in\nthe `upper_rows` array. Iteration starts from row specified in `min_row`.",
|
||||
"itemtype": "method",
|
||||
"name": "get_valid_rows",
|
||||
@ -895,7 +895,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1092,
|
||||
"line": 1103,
|
||||
"description": "Get widgets overlapping with the player.",
|
||||
"itemtype": "method",
|
||||
"name": "get_widgets_overlapped",
|
||||
@ -907,7 +907,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1125,
|
||||
"line": 1136,
|
||||
"description": "This callback is executed when the player begins to collide with a column.",
|
||||
"itemtype": "method",
|
||||
"name": "on_start_overlapping_column",
|
||||
@ -926,7 +926,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1137,
|
||||
"line": 1148,
|
||||
"description": "A callback executed when the player begins to collide with a row.",
|
||||
"itemtype": "method",
|
||||
"name": "on_start_overlapping_row",
|
||||
@ -945,7 +945,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1149,
|
||||
"line": 1160,
|
||||
"description": "A callback executed when the the player ends to collide with a column.",
|
||||
"itemtype": "method",
|
||||
"name": "on_stop_overlapping_column",
|
||||
@ -964,7 +964,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1167,
|
||||
"line": 1178,
|
||||
"description": "This callback is executed when the player ends to collide with a row.",
|
||||
"itemtype": "method",
|
||||
"name": "on_stop_overlapping_row",
|
||||
@ -983,7 +983,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1187,
|
||||
"line": 1198,
|
||||
"description": "Move a widget to a specific row. The cell or cells must be empty.\nIf the widget has widgets below, all of these widgets will be moved also\nif they can.",
|
||||
"itemtype": "method",
|
||||
"name": "move_widget_to",
|
||||
@ -1002,7 +1002,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1230,
|
||||
"line": 1241,
|
||||
"description": "Move up the specified widget and all below it.",
|
||||
"itemtype": "method",
|
||||
"name": "move_widget_up",
|
||||
@ -1027,7 +1027,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1276,
|
||||
"line": 1287,
|
||||
"description": "Move down the specified widget and all below it.",
|
||||
"itemtype": "method",
|
||||
"name": "move_widget_down",
|
||||
@ -1051,7 +1051,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1321,
|
||||
"line": 1332,
|
||||
"description": "Check if the widget can move to the specified row, else returns the\nupper row possible.",
|
||||
"itemtype": "method",
|
||||
"name": "can_go_up_to_row",
|
||||
@ -1080,7 +1080,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1410,
|
||||
"line": 1421,
|
||||
"description": "Get widgets below a widget.",
|
||||
"itemtype": "method",
|
||||
"name": "widgets_below",
|
||||
@ -1099,7 +1099,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1439,
|
||||
"line": 1450,
|
||||
"description": "Update the array of mapped positions with the new player position.",
|
||||
"itemtype": "method",
|
||||
"name": "set_cells_player_occupies",
|
||||
@ -1123,7 +1123,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1456,
|
||||
"line": 1467,
|
||||
"description": "Remove from the array of mapped positions the reference to the player.",
|
||||
"itemtype": "method",
|
||||
"name": "empty_cells_player_occupies",
|
||||
@ -1135,7 +1135,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1493,
|
||||
"line": 1504,
|
||||
"description": "Check if it's possible to move a widget to a specific col/row. It takes\ninto account the dimensions (`size_y` and `size_x` attrs. of the grid coords\n object) the widget occupies.",
|
||||
"itemtype": "method",
|
||||
"name": "can_move_to",
|
||||
@ -1164,7 +1164,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1528,
|
||||
"line": 1539,
|
||||
"description": "Given the leftmost column returns all columns that are overlapping with the player.",
|
||||
"itemtype": "method",
|
||||
"name": "get_targeted_columns",
|
||||
@ -1184,7 +1184,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1546,
|
||||
"line": 1557,
|
||||
"description": "Given the upper row returns all rows that are overlapping with the player.",
|
||||
"itemtype": "method",
|
||||
"name": "get_targeted_rows",
|
||||
@ -1204,7 +1204,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1563,
|
||||
"line": 1574,
|
||||
"description": "Get all columns and rows that a widget occupies.",
|
||||
"itemtype": "method",
|
||||
"name": "get_cells_occupied",
|
||||
@ -1223,7 +1223,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1591,
|
||||
"line": 1602,
|
||||
"description": "Iterate over the cells occupied by a widget executing a function for\neach one.",
|
||||
"itemtype": "method",
|
||||
"name": "for_each_cell_occupied",
|
||||
@ -1247,7 +1247,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1612,
|
||||
"line": 1623,
|
||||
"description": "Iterate over the columns occupied by a widget executing a function for\neach one.",
|
||||
"itemtype": "method",
|
||||
"name": "for_each_column_occupied",
|
||||
@ -1271,7 +1271,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1631,
|
||||
"line": 1642,
|
||||
"description": "Iterate over the rows occupied by a widget executing a function for\neach one.",
|
||||
"itemtype": "method",
|
||||
"name": "for_each_row_occupied",
|
||||
@ -1295,7 +1295,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1697,
|
||||
"line": 1708,
|
||||
"description": "Iterate over each widget above the column and row specified.",
|
||||
"itemtype": "method",
|
||||
"name": "for_each_widget_above",
|
||||
@ -1324,7 +1324,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1713,
|
||||
"line": 1724,
|
||||
"description": "Iterate over each widget below the column and row specified.",
|
||||
"itemtype": "method",
|
||||
"name": "for_each_widget_below",
|
||||
@ -1353,7 +1353,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1729,
|
||||
"line": 1740,
|
||||
"description": "Returns the highest occupied cell in the grid.",
|
||||
"itemtype": "method",
|
||||
"name": "get_highest_occupied_cell",
|
||||
@ -1365,7 +1365,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1761,
|
||||
"line": 1772,
|
||||
"description": "Set the current height of the parent grid.",
|
||||
"itemtype": "method",
|
||||
"name": "set_dom_grid_height",
|
||||
@ -1377,7 +1377,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1774,
|
||||
"line": 1785,
|
||||
"description": "It generates the neccessary styles to position the widgets.",
|
||||
"itemtype": "method",
|
||||
"name": "generate_stylesheet",
|
||||
@ -1401,7 +1401,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1818,
|
||||
"line": 1829,
|
||||
"description": "Injects the given CSS as string to the head of the document.",
|
||||
"itemtype": "method",
|
||||
"name": "add_style_tag",
|
||||
@ -1420,7 +1420,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1841,
|
||||
"line": 1852,
|
||||
"description": "Generates a faux grid to collide with it when a widget is dragged and\ndetect row or column that we want to go.",
|
||||
"itemtype": "method",
|
||||
"name": "generate_faux_grid",
|
||||
@ -1444,7 +1444,19 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1877,
|
||||
"line": 1888,
|
||||
"description": "Recalculates the offsets for the faux grid. You need to use it when\nthe browser is resized.",
|
||||
"itemtype": "method",
|
||||
"name": "recalculate_faux_grid",
|
||||
"return": {
|
||||
"description": "Returns the instance of the Gridster class.",
|
||||
"type": "Object"
|
||||
},
|
||||
"class": "Gridster"
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1912,
|
||||
"description": "Get all widgets in the DOM and register them.",
|
||||
"itemtype": "method",
|
||||
"name": "get_widgets_from_DOM",
|
||||
@ -1456,7 +1468,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/jquery.gridster.js",
|
||||
"line": 1891,
|
||||
"line": 1926,
|
||||
"description": "Calculate columns and rows to be set based on the configuration\n parameters, grid dimensions, etc ...",
|
||||
"itemtype": "method",
|
||||
"name": "generate_grid_and_stylesheet",
|
||||
|
@ -127,7 +127,7 @@
|
||||
this.original_coords = this.get();
|
||||
};
|
||||
|
||||
fn.set = function(update) {
|
||||
fn.set = function() {
|
||||
var el = this.el;
|
||||
if (el) {
|
||||
this.data = el.offset();
|
||||
@ -159,7 +159,7 @@
|
||||
var new_data = $.extend(this.data, data);
|
||||
this.data = new_data;
|
||||
}
|
||||
this.set(true);
|
||||
this.set();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -115,12 +115,8 @@
|
||||
row: wgd.row
|
||||
};
|
||||
},
|
||||
collision: {
|
||||
on_overlap: function(coords) {}
|
||||
},
|
||||
draggable: {
|
||||
|
||||
}
|
||||
collision: {},
|
||||
draggable: {}
|
||||
};
|
||||
|
||||
|
||||
@ -142,7 +138,8 @@
|
||||
|
||||
var throttle = function(func, wait) {
|
||||
var context, args, timeout, throttling, more, result;
|
||||
var whenDone = debounce(function(){ more = throttling = false; }, wait, true);
|
||||
var whenDone = debounce(
|
||||
function(){ more = throttling = false; }, wait, true);
|
||||
return function() {
|
||||
context = this; args = arguments;
|
||||
var later = function() {
|
||||
@ -170,14 +167,14 @@
|
||||
* @param {HTMLElement} el The HTMLelement that contains all the widgets.
|
||||
* @param {Object} [options] An Object with all options you want to
|
||||
* overwrite:
|
||||
* @param {HTMLElement|String} [options.widget_selector] Define who will be the
|
||||
* draggable widgets. Can be a CSS Selector String or a collection of
|
||||
* HTMLElements
|
||||
* @param {Array} [options.widget_margins] Margin between widgets. The first
|
||||
* index for the horizontal margin (left, right) and the second
|
||||
* for the vertical margin (top, bottom).
|
||||
* @param {Array} [options.widget_base_dimensions] Base widget dimensions in
|
||||
* pixels. The first index for the width and the second for the
|
||||
* @param {HTMLElement|String} [options.widget_selector] Define who will
|
||||
* be the draggable widgets. Can be a CSS Selector String or a
|
||||
* collection of HTMLElements
|
||||
* @param {Array} [options.widget_margins] Margin between widgets.
|
||||
* The first index for the horizontal margin (left, right) and
|
||||
* the second for the vertical margin (top, bottom).
|
||||
* @param {Array} [options.widget_base_dimensions] Base widget dimensions
|
||||
* in pixels. The first index for the width and the second for the
|
||||
* height.
|
||||
* @param {Number} [options.extra_cols] Add more columns in addition to
|
||||
* those that have been calculated.
|
||||
@ -227,6 +224,9 @@
|
||||
this.set_dom_grid_height();
|
||||
this.$wrapper.addClass('ready');
|
||||
this.draggable();
|
||||
|
||||
$(window).bind(
|
||||
'resize', throttle($.proxy(this.recalculate_faux_grid, this), 200));
|
||||
};
|
||||
|
||||
|
||||
@ -322,7 +322,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Creates the grid coords object representing the widget a add it to the mapped array of positions
|
||||
* Creates the grid coords object representing the widget a add it to the
|
||||
* mapped array of positions.
|
||||
*
|
||||
* @method register_widget
|
||||
* @return {Array} Returns the instance of the Gridster class.
|
||||
@ -416,6 +417,9 @@
|
||||
// containment : this.$wrapper,
|
||||
start: function(event, ui) {
|
||||
self.$player = $(this);
|
||||
self.$helper = self.options.draggable.helper === 'clone' ?
|
||||
$(ui.helper) : self.$player;
|
||||
|
||||
self.on_start_drag.call(self, event, ui);
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
@ -446,7 +450,6 @@
|
||||
this.player_grid_data = this.$player.coords().grid;
|
||||
this.placeholder_grid_data = $.extend({}, this.player_grid_data);
|
||||
|
||||
|
||||
//set new grid height along the dragging period
|
||||
this.$el.css('height', this.$el.height() +
|
||||
(this.player_grid_data.size_y * this.min_widget_height));
|
||||
@ -454,14 +457,17 @@
|
||||
var colliders = this.faux_grid;
|
||||
var coords = this.$player.data('coords').coords;
|
||||
|
||||
this.cells_occupied_by_player = this.get_cells_occupied(this.player_grid_data);
|
||||
this.cells_occupied_by_placeholder = this.get_cells_occupied(this.placeholder_grid_data);
|
||||
this.cells_occupied_by_player = this.get_cells_occupied(
|
||||
this.player_grid_data);
|
||||
this.cells_occupied_by_placeholder = this.get_cells_occupied(
|
||||
this.placeholder_grid_data);
|
||||
|
||||
this.last_cols = [];
|
||||
this.last_rows = [];
|
||||
|
||||
// see jquery.collision.js
|
||||
this.drag_api = this.$player.collision(colliders, this.options.collision);
|
||||
this.drag_api = this.$helper.collision(
|
||||
colliders, this.options.collision);
|
||||
|
||||
this.$preview_holder = $('<li />', {
|
||||
'class': 'preview-holder',
|
||||
@ -526,7 +532,7 @@
|
||||
this.on_stop_overlapping_row
|
||||
);
|
||||
|
||||
this.$player.attr({
|
||||
this.$player.add(this.$helper).attr({
|
||||
'data-col': this.placeholder_grid_data.col,
|
||||
'data-row': this.placeholder_grid_data.row
|
||||
}).css({
|
||||
@ -722,7 +728,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of each widget) in ascending way.
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of
|
||||
* each widget) in ascending way.
|
||||
*
|
||||
* @method sort_by_row_asc
|
||||
* @param {Array} widgets Array of grid coords objects
|
||||
@ -741,7 +748,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of
|
||||
* each widget) in descending way.
|
||||
*
|
||||
* @method sort_by_row_desc
|
||||
* @param {Array} widgets Array of grid coords objects
|
||||
@ -759,7 +767,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of each widget) in descending way.
|
||||
* Sorts an Array of grid coords objects (representing the grid coords of
|
||||
* each widget) in descending way.
|
||||
*
|
||||
* @method manage_movements
|
||||
* @param {HTMLElements} $widgets A jQuery collection of HTMLElements
|
||||
@ -816,7 +825,7 @@
|
||||
fn.is_player = function(col_or_el, row) {
|
||||
if (row && !this.gridmap[col_or_el]) { return false; }
|
||||
var $w = row ? this.gridmap[col_or_el][row] : col_or_el;
|
||||
return $w && $w.is(this.$player);
|
||||
return $w && ($w.is(this.$player) || $w.is(this.$helper));
|
||||
};
|
||||
|
||||
|
||||
@ -998,7 +1007,8 @@
|
||||
|
||||
if (moved_down || changed_column) {
|
||||
$nexts.each($.proxy(function(i, widget){
|
||||
this.move_widget_up( $(widget) , this.placeholder_grid_data.col - col + phgd.size_y );
|
||||
this.move_widget_up(
|
||||
$(widget), this.placeholder_grid_data.col - col + phgd.size_y);
|
||||
}, this));
|
||||
}
|
||||
|
||||
@ -1030,7 +1040,8 @@
|
||||
|
||||
while (--r > 0){
|
||||
if (this.is_empty(tcol, r) || this.is_player(tcol, r) ||
|
||||
this.is_widget(tcol, r) && grid_col[r].is($widgets_under_player)
|
||||
this.is_widget(tcol, r) &&
|
||||
grid_col[r].is($widgets_under_player)
|
||||
) {
|
||||
upper_rows[tcol].push(r);
|
||||
min_row = r < min_row ? r : min_row;
|
||||
@ -1945,7 +1956,6 @@
|
||||
this.gridmap = [];
|
||||
var col;
|
||||
var row;
|
||||
|
||||
for (col = cols; col > 0; col--) {
|
||||
this.gridmap[col] = [];
|
||||
for (row = rows; row > 0; row--) {
|
||||
@ -1967,6 +1977,31 @@
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Recalculates the offsets for the faux grid. You need to use it when
|
||||
* the browser is resized.
|
||||
*
|
||||
* @method recalculate_faux_grid
|
||||
* @return {Object} Returns the instance of the Gridster class.
|
||||
*/
|
||||
fn.recalculate_faux_grid = function() {
|
||||
var aw = this.$wrapper.width();
|
||||
this.baseX = ($(window).width() - aw) / 2;
|
||||
this.baseY = this.$wrapper.offset().top;
|
||||
|
||||
$.each(this.faux_grid, $.proxy(function(i, coords){
|
||||
this.faux_grid[i] = coords.update({
|
||||
left: this.baseX + (coords.data.col -1) * this.min_widget_width,
|
||||
top: this.baseY + (coords.data.row -1) * this.min_widget_height
|
||||
});
|
||||
|
||||
}, this));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get all widgets in the DOM and register them.
|
||||
*
|
||||
@ -1989,13 +2024,12 @@
|
||||
* @return {Object} Returns the instance of the Gridster class.
|
||||
*/
|
||||
fn.generate_grid_and_stylesheet = function() {
|
||||
var grid_width;
|
||||
var aw = this.$wrapper.width();
|
||||
var ah = this.$wrapper.height();
|
||||
|
||||
var cols = Math.floor(aw/this.min_widget_width) +
|
||||
var cols = Math.floor(aw / this.min_widget_width) +
|
||||
this.options.extra_cols;
|
||||
var rows = Math.floor(ah/this.min_widget_height) +
|
||||
var rows = Math.floor(ah / this.min_widget_height) +
|
||||
this.options.extra_rows;
|
||||
|
||||
var actual_cols = this.$widgets.map(function() {
|
||||
@ -2011,18 +2045,16 @@
|
||||
|
||||
cols = Math.max(min_cols, cols, this.options.min_cols);
|
||||
rows = Math.max(min_rows, rows, this.options.min_rows);
|
||||
grid_width = cols * (this.options.widget_base_dimensions[0] +
|
||||
(this.options.widget_margins[0] * 2));
|
||||
|
||||
//this.support_grid_width = cols * this.min_widget_width;
|
||||
this.support_grid_width = this.wrapper_width;
|
||||
// this.support_grid_width = this.wrapper_width;
|
||||
|
||||
this.support_grid_height = rows * this.min_widget_height;
|
||||
this.baseX = ($(window).width() - this.support_grid_width) / 2;
|
||||
// this.support_grid_height = rows * this.min_widget_height;
|
||||
this.baseX = ($(window).width() - aw) / 2;
|
||||
this.baseY = this.$wrapper.offset().top;
|
||||
|
||||
//this.baseX = 0;
|
||||
if(this.options.autogenerate_stylesheet) {
|
||||
if (this.options.autogenerate_stylesheet) {
|
||||
this.generate_stylesheet(rows, cols);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user