소스 검색

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

Enrico Berti 8 년 전
부모
커밋
3edf8e2
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      desktop/core/src/desktop/static/desktop/js/gridster-knockout.js

+ 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');