Skip to content

Commit

Permalink
Editor: Elements added in quick succession create multiple widgets (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao authored Sep 30, 2024
1 parent be2d16e commit 1914bcc
Show file tree
Hide file tree
Showing 5 changed files with 1,127 additions and 1,020 deletions.
7 changes: 4 additions & 3 deletions ui/src/editor-core/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ PropertiesPanel.prototype.save = function(
mainObject,
{
reloadPropertiesPanel: false,
}).done(() => {
},
).then(() => {
if (!target.drawerWidget) {
app.viewer.renderRegion(
app.getObjectByTypeAndId('region', target.regionId),
Expand Down Expand Up @@ -1784,7 +1785,7 @@ PropertiesPanel.prototype.render = function(
mainObject,
{
reloadPropertiesPanel: false,
}).done(() => {
}).then(() => {
if (!target.drawerWidget) {
app.viewer.renderRegion(
app.getObjectByTypeAndId('region', target.regionId),
Expand Down Expand Up @@ -2861,7 +2862,7 @@ PropertiesPanel.prototype.showWidgetControl = function(target) {
{
reloadPropertiesPanel: false,
},
).done(() => {
).then(() => {
// Add options to dropdown
const $select =
$canvasWidgetSelectorControl.find('select');
Expand Down
7 changes: 4 additions & 3 deletions ui/src/editor-core/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ Widget.prototype.saveElements = function(
return;
}

app.reloadData(app.layout,
return app.reloadData(app.layout,
{
refreshEditor: updateEditor,
});
Expand Down Expand Up @@ -1068,8 +1068,10 @@ Widget.prototype.saveElements = function(
// Clear request var after response
self.saveElementsRequest = undefined;

lD.common.hideLoadingScreen();

if (res.success) {
reloadLayout();
return reloadLayout();
} else {
// Login Form needed?
if (res.login) {
Expand All @@ -1085,7 +1087,6 @@ Widget.prototype.saveElements = function(
}
}
}
lD.common.hideLoadingScreen();
});

// If this request is forced, save flag and return request
Expand Down
Loading

0 comments on commit 1914bcc

Please sign in to comment.