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
Reference in New Issue
Block a user