Skip to content

Commit

Permalink
XP-1846 Grid not refreshed, when content deleted
Browse files Browse the repository at this point in the history
- restoring lost code
  • Loading branch information
pmi committed Oct 21, 2015
1 parent 34db92d commit 35903f7
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,7 @@ module app.browse {
if (publishResult[i].getId() === el.getId()) {
new api.content.ContentPublishedEvent(new api.content.ContentId(el.getId())).fire();
publishResult[i].updateNodeData(el);

var selectedItems = this.getBrowseItemPanel().getItems();
var viewItem = selectedItems[selectedItems.length - 1].toViewItem();
this.updateDetailsPanels(el.getContentId(), el.getCompareStatus(), viewItem);
this.updateDetailsPanels(el.getContentId(), el.getCompareStatus());
break;
}
}
Expand Down Expand Up @@ -564,18 +561,20 @@ module app.browse {
}

private updateDetailsPanels(contentId: ContentId, status: CompareStatus, viewItem?: api.app.view.ViewItem<ContentSummary>) {

this.defaultDockedDetailsPanel.setItem(viewItem);
this.floatingDetailsPanel.setItem(viewItem);
this.mobileContentItemStatisticsPanel.setItem(viewItem);
if (viewItem !== undefined) {
this.defaultDockedDetailsPanel.setItem(viewItem);
this.floatingDetailsPanel.setItem(viewItem);
this.mobileContentItemStatisticsPanel.setItem(viewItem);
}

this.updateDetailsPanelContentStatus(this.defaultDockedDetailsPanel, contentId, status);
this.updateDetailsPanelContentStatus(this.floatingDetailsPanel, contentId, status);
this.updateDetailsPanelContentStatus(this.mobileContentItemStatisticsPanel.getDetailsPanel(), contentId, status);
}

private updateDetailsPanelContentStatus(detailsPanel: DetailsPanel, contentId: ContentId, status: CompareStatus) {
if (contentId && contentId.equals(detailsPanel.getItem().getModel().getContentId())) {
var item = detailsPanel.getItem();
if (contentId && item && contentId.equals(item.getModel().getContentId())) {
detailsPanel.setContentStatus(status);
}
}
Expand Down

0 comments on commit 35903f7

Please sign in to comment.