mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix(gridster): fixed expand_widget bug not expanding full width of window
fix(gridster): user can specify size_x when expanding widget
This commit is contained in:
@ -499,15 +499,15 @@
|
||||
* @method expand_widget
|
||||
* @param {HTMLElement} $widget The jQuery wrapped HTMLElement
|
||||
* representing the widget.
|
||||
* @param {Number} size_x The number of cols that will occupy the widget.
|
||||
* @param {Number} size_y The number of rows that will occupy the widget.
|
||||
* @param {Function} [callback] Function executed when the widget is removed.
|
||||
* @return {HTMLElement} Returns $widget.
|
||||
*/
|
||||
fn.expand_widget = function($widget, size_y, callback) {
|
||||
fn.expand_widget = function($widget, size_x, size_y, callback) {
|
||||
var wgd = $widget.coords().grid;
|
||||
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) /
|
||||
(this.min_widget_width + this.options.widget_margins[0] * 2));
|
||||
var size_x = Math.min(max_size_x, this.cols);
|
||||
var max_size_x = Math.floor(($(window).width() - this.options.widget_margins[0] * 2) / this.min_widget_width);
|
||||
size_x = size_x || Math.min(max_size_x, this.cols);
|
||||
size_y || (size_y = wgd.size_y);
|
||||
|
||||
var old_size_y = wgd.size_y;
|
||||
|
Reference in New Issue
Block a user