mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Fix: widget is not removed from dashboard, only after page refresh
This commit is contained in:
parent
17f3b1e92d
commit
8ec0cda10b
@ -71,7 +71,8 @@ function DashboardWidgetCtrl($location, $uibModal, $window, Events, currentUser)
|
||||
Events.record('delete', 'widget', this.widget.id);
|
||||
|
||||
this.widget.$delete((response) => {
|
||||
this.dashboard.widgets = this.dashboard.widgets.filter(widget => widget.id !== undefined);
|
||||
this.dashboard.widgets = this.dashboard.widgets
|
||||
.filter(widget => (widget.id !== undefined) && (widget.id !== this.widget.id));
|
||||
this.dashboard.version = response.version;
|
||||
if (this.deleted) {
|
||||
this.deleted({});
|
||||
|
@ -317,7 +317,11 @@ function DashboardCtrl(
|
||||
this.removeWidget = () => {
|
||||
this.extractGlobalParameters();
|
||||
if (!this.layoutEditing) {
|
||||
saveDashboardLayout();
|
||||
// We need to wait a bit for `angular-gridster` before it updates widgets,
|
||||
// and only then save new layout
|
||||
$timeout(() => {
|
||||
saveDashboardLayout();
|
||||
}, 50);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user