Pārlūkot izejas kodu

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

Enrico Berti 8 gadi atpakaļ
vecāks
revīzija
b69a778

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