Jelajahi Sumber

HUE-7949 [dashboard] Sync the position to the model on widget add and remove

Enrico Berti 7 tahun lalu
induk
melakukan
3edf8e2

+ 2 - 1
desktop/core/src/desktop/static/desktop/js/gridster-knockout.js

@@ -97,10 +97,11 @@ ko.bindingHandlers.gridster = {
             if (change.value.callback) {
               ko.unwrap(change.value.callback)(addedWidget);
             }
+            syncPositionsToModel();
             break;
           case 'deleted':
             huePubSub.publish('gridster.deleted.widget', change.value.gridsterElement);
-            gridster.remove_widget(change.value.gridsterElement);
+            gridster.remove_widget(change.value.gridsterElement, syncPositionsToModel);
             break;
           default:
             throw new Error('Unexpected change.status');