mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
Better handling of widgets slideing down
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.1.0 - 2013-04-02
|
||||
/*! gridster.js - v0.1.0 - 2013-04-03
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2013 ducksboard; Licensed MIT */
|
||||
|
||||
|
||||
Vendored
+36
-26
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.1.0 - 2013-04-02
|
||||
/*! gridster.js - v0.1.0 - 2013-04-03
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2013 ducksboard; Licensed MIT */
|
||||
|
||||
@@ -1695,7 +1695,19 @@
|
||||
}
|
||||
|
||||
}
|
||||
} else if ($gr.options.shift_larger_widgets_down && !swap) {
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
$gr.set_placeholder(to_col, to_row);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
$gr.clean_up_changed();
|
||||
}));
|
||||
|
||||
|
||||
@@ -1718,20 +1730,6 @@
|
||||
this.set_placeholder(to_col, to_row);
|
||||
}
|
||||
|
||||
///If set to false smaller widgets will not displace larger widgets.
|
||||
if(this.options.shift_larger_widgets_down && !swap){
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* if there is not widgets overlapping in the new player position,
|
||||
* update the new placeholder position. */
|
||||
if (!$overlapped_widgets.length) {
|
||||
@@ -2570,11 +2568,12 @@
|
||||
fn.on_stop_overlapping_column = function(col) {
|
||||
//this.set_player(col, false);
|
||||
var self = this;
|
||||
/*this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_column");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2589,12 +2588,14 @@
|
||||
//this.set_player(false, row);
|
||||
var self = this;
|
||||
var cols = this.cells_occupied_by_player.cols;
|
||||
/*for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Not yet part of api - DM.
|
||||
@@ -3113,6 +3114,15 @@
|
||||
}
|
||||
};
|
||||
|
||||
fn.clean_up_changed = function(){
|
||||
$gr = this;
|
||||
$gr.$changed.each(function(){
|
||||
if($gr.options.shift_larger_widgets_down){
|
||||
$gr.move_widget_up($(this));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn._traversing_widgets = function(type, direction, col, row, callback) {
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
/*! gridster.js - v0.1.0 - 2013-04-02
|
||||
/*! gridster.js - v0.1.0 - 2013-04-03
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2013 ducksboard; Licensed MIT */.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}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+36
-26
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.1.0 - 2013-04-02
|
||||
/*! gridster.js - v0.1.0 - 2013-04-03
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2013 ducksboard; Licensed MIT */
|
||||
|
||||
@@ -1695,7 +1695,19 @@
|
||||
}
|
||||
|
||||
}
|
||||
} else if ($gr.options.shift_larger_widgets_down && !swap) {
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
$gr.set_placeholder(to_col, to_row);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
$gr.clean_up_changed();
|
||||
}));
|
||||
|
||||
|
||||
@@ -1718,20 +1730,6 @@
|
||||
this.set_placeholder(to_col, to_row);
|
||||
}
|
||||
|
||||
///If set to false smaller widgets will not displace larger widgets.
|
||||
if(this.options.shift_larger_widgets_down && !swap){
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* if there is not widgets overlapping in the new player position,
|
||||
* update the new placeholder position. */
|
||||
if (!$overlapped_widgets.length) {
|
||||
@@ -2570,11 +2568,12 @@
|
||||
fn.on_stop_overlapping_column = function(col) {
|
||||
//this.set_player(col, false);
|
||||
var self = this;
|
||||
/*this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_column");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2589,12 +2588,14 @@
|
||||
//this.set_player(false, row);
|
||||
var self = this;
|
||||
var cols = this.cells_occupied_by_player.cols;
|
||||
/*for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Not yet part of api - DM.
|
||||
@@ -3113,6 +3114,15 @@
|
||||
}
|
||||
};
|
||||
|
||||
fn.clean_up_changed = function(){
|
||||
$gr = this;
|
||||
$gr.$changed.each(function(){
|
||||
if($gr.options.shift_larger_widgets_down){
|
||||
$gr.move_widget_up($(this));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn._traversing_widgets = function(type, direction, col, row, callback) {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+2
-3
@@ -14,7 +14,7 @@
|
||||
<link rel="stylesheet" href="css/normalize.css">
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="../dist/jquery.gridster.min.js"></script>
|
||||
<script src="../dist/jquery.gridster.js"></script>
|
||||
<link rel="stylesheet" href="../dist/jquery.gridster.min.css">
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -23,8 +23,7 @@
|
||||
$(".gridster ul").gridster({
|
||||
widget_margins: [10, 10],
|
||||
widget_base_dimensions: [140, 140],
|
||||
max_cols: 6,
|
||||
shift_larger_widgets_down: false
|
||||
max_cols: 6
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
+35
-25
@@ -999,7 +999,19 @@
|
||||
}
|
||||
|
||||
}
|
||||
} else if ($gr.options.shift_larger_widgets_down && !swap) {
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
$gr.set_placeholder(to_col, to_row);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
$gr.clean_up_changed();
|
||||
}));
|
||||
|
||||
|
||||
@@ -1022,20 +1034,6 @@
|
||||
this.set_placeholder(to_col, to_row);
|
||||
}
|
||||
|
||||
///If set to false smaller widgets will not displace larger widgets.
|
||||
if(this.options.shift_larger_widgets_down && !swap){
|
||||
$overlapped_widgets.each($.proxy(function(i, w){
|
||||
var $w = $(w);
|
||||
var wgd = $w.coords().grid;
|
||||
|
||||
if($gr.can_go_down($w)){
|
||||
$gr.move_widget_down($w, $gr.player_grid_data.size_y);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* if there is not widgets overlapping in the new player position,
|
||||
* update the new placeholder position. */
|
||||
if (!$overlapped_widgets.length) {
|
||||
@@ -1874,11 +1872,12 @@
|
||||
fn.on_stop_overlapping_column = function(col) {
|
||||
//this.set_player(col, false);
|
||||
var self = this;
|
||||
/*this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_column");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
|
||||
function(tcol, trow) {
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1893,12 +1892,14 @@
|
||||
//this.set_player(false, row);
|
||||
var self = this;
|
||||
var cols = this.cells_occupied_by_player.cols;
|
||||
/*for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}*/
|
||||
if(this.options.shift_larger_widgets_down){
|
||||
for (var c = 0, cl = cols.length; c < cl; c++) {
|
||||
this.for_each_widget_below(cols[c], row, function(tcol, trow) {
|
||||
console.log("from_on_stop_overlapping_row");
|
||||
self.move_widget_up(this, self.player_grid_data.size_y);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Not yet part of api - DM.
|
||||
@@ -2417,6 +2418,15 @@
|
||||
}
|
||||
};
|
||||
|
||||
fn.clean_up_changed = function(){
|
||||
$gr = this;
|
||||
$gr.$changed.each(function(){
|
||||
if($gr.options.shift_larger_widgets_down){
|
||||
$gr.move_widget_up($(this));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn._traversing_widgets = function(type, direction, col, row, callback) {
|
||||
|
||||
Reference in New Issue
Block a user