fix: [dashboard] Fixed adding widgets losing their config settings

pull/5635/head
iglocska 2020-03-01 19:03:31 +01:00
parent f6f66e0f31
commit ec2c7a5569
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 6 additions and 1 deletions

View File

@ -4896,7 +4896,7 @@ function submitDashboardAddWidget() {
var width = $('#DashboardWidth').val();
var height = $('#DashboardHeight').val();
var el = null;
var k = $('#last-element-counter').data('data-element-counter');
var k = $('#last-element-counter').data('element-counter');
$.ajax({
url: baseurl + '/dashboards/getEmptyWidget/' + widget + '/' + (k+1),
type: 'GET',
@ -4911,6 +4911,11 @@ function submitDashboardAddWidget() {
"autoposition": 1
}
);
config = JSON.parse(config);
config = JSON.stringify(config);
$('#widget_' + (k+1)).attr('config', config);
updateDashboardWidget($('#widget_' + (k+1)));
saveDashboardState();
},
complete: function(data) {
$('#genericModal').modal('hide');