mirror of https://github.com/MISP/MISP
fix: [dashboard] grid scope fix
parent
e0ad3ec9a4
commit
f1faa7845f
|
@ -46,7 +46,7 @@ class AppController extends Controller
|
|||
|
||||
public $helpers = array('Utility', 'OrgImg', 'FontAwesome', 'UserName');
|
||||
|
||||
private $__queryVersion = '100';
|
||||
private $__queryVersion = '101';
|
||||
public $pyMispVersion = '2.4.122';
|
||||
public $phpmin = '7.2';
|
||||
public $phprec = '7.4';
|
||||
|
|
|
@ -15,32 +15,12 @@
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
function resetDashboardGrid(grid) {
|
||||
$('.grid-stack-item').each(function() {
|
||||
updateDashboardWidget(this);
|
||||
});
|
||||
saveDashboardState();
|
||||
$('.edit-widget').click(function() {
|
||||
el = $(this).closest('.grid-stack-item');
|
||||
data = {
|
||||
id: el.attr('id'),
|
||||
config: JSON.parse(el.attr('config')),
|
||||
widget: el.attr('widget'),
|
||||
alias: el.attr('alias')
|
||||
}
|
||||
openGenericModalPost(baseurl + '/dashboards/getForm/edit', data);
|
||||
});
|
||||
$('.remove-widget').click(function() {
|
||||
el = $(this).closest('.grid-stack-item');
|
||||
grid.removeWidget(el);
|
||||
saveDashboardState();
|
||||
});
|
||||
}
|
||||
|
||||
var grid = false;
|
||||
$(document).ready(function () {
|
||||
var grid = GridStack.init({verticalMargin: 2});
|
||||
grid = GridStack.init({verticalMargin: 2});
|
||||
resetDashboardGrid(grid);
|
||||
grid.on('change', function(event, items) {
|
||||
alert(1);
|
||||
saveDashboardState();
|
||||
});
|
||||
grid.on('added', function(event, items) {
|
||||
|
|
|
@ -4905,7 +4905,6 @@ function submitDashboardAddWidget() {
|
|||
type: 'GET',
|
||||
success: function(data) {
|
||||
el = data;
|
||||
var grid = GridStack.init();
|
||||
grid.addWidget(
|
||||
el,
|
||||
{
|
||||
|
@ -4989,6 +4988,28 @@ function updateDashboardWidget(element) {
|
|||
}
|
||||
}
|
||||
|
||||
function resetDashboardGrid(grid) {
|
||||
$('.grid-stack-item').each(function() {
|
||||
updateDashboardWidget(this);
|
||||
});
|
||||
saveDashboardState();
|
||||
$('.edit-widget').click(function() {
|
||||
el = $(this).closest('.grid-stack-item');
|
||||
data = {
|
||||
id: el.attr('id'),
|
||||
config: JSON.parse(el.attr('config')),
|
||||
widget: el.attr('widget'),
|
||||
alias: el.attr('alias')
|
||||
}
|
||||
openGenericModalPost(baseurl + '/dashboards/getForm/edit', data);
|
||||
});
|
||||
$('.remove-widget').click(function() {
|
||||
el = $(this).closest('.grid-stack-item');
|
||||
grid.removeWidget(el);
|
||||
saveDashboardState();
|
||||
});
|
||||
}
|
||||
|
||||
function setHomePage() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
|
Loading…
Reference in New Issue