瀏覽代碼

HUE-7791 [dashboard] Dropping a counter on Gridster shouldn't clone the last one dropped

Enrico Berti 8 年之前
父節點
當前提交
b69a778
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

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

@@ -3662,7 +3662,9 @@ $(document).ready(function () {
 
   var tempDraggable = null;
   huePubSub.subscribe('dashboard.top.widget.drag.start', function (options) {
-    tempDraggable = options.widget;
+    var widgetClone = ko.mapping.toJS(options.widget);
+    widgetClone.id = UUID();
+    tempDraggable = new Widget(widgetClone);
     addPreviewHolder();
   }, 'dashboard');