소스 검색

HUE-7949 [dashboard] Update Gridster model after deleting a widget

Enrico Berti 7 년 전
부모
커밋
ccfe80d233
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

+ 4 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -4241,7 +4241,10 @@ $(document).ready(function () {
     for (var i = 1; i <= siblings.length; i++) {
       var widget = siblings[i - 1];
       $gridster.resize_widget($(widget.gridsterElement), optimalWidgetWidth, widget.size_y());
-      $gridster.move_widget($(widget.gridsterElement), ((i - 1) * optimalWidgetWidth) + 1, widget.row());
+      widget.size_x(optimalWidgetWidth);
+      var newCol = ((i - 1) * optimalWidgetWidth) + 1;
+      $gridster.move_widget($(widget.gridsterElement), newCol, widget.row());
+      widget.col(newCol);
     }
     searchViewModel.gridItems.remove(gridElement);
     huePubSub.publish('gridster.clean.whitespace');