Arthur Bogaart pushed to branch feature/cmng-psp1-CHANNELMGR-592 at cms-community / hippo-addon-channel-manager
Commits: c95e0180 by Arthur Bogaart at 2016-04-28T14:22:34+02:00 CHANNELMGR-609 Review changes I simplified the code in #deleteComponent a bit and fixed mvn lint - - - - - 2 changed files: - frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.js - frontend/src/main/resources/org/onehippo/cms7/channelmanager/channeleditor/ChannelEditor.js Changes: ===================================== frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.js ===================================== --- a/frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.js +++ b/frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.js @@ -94,16 +94,18 @@ export class HippoIframeCtrl { this.$log.warn(`Cannot delete unknown component with id:'${componentId}'`); return; } - this._confirmDelete(selectedComponent) - .then(() => this.PageStructureService.removeComponentById(componentId) - .then( - ({ oldContainer, newContainer }) => this.DragDropService.replaceContainer(oldContainer, newContainer), - () => { - // inform extjs to reset the component properties dialog if deletion is failed - this.CmsService.publish('reset-component-properties'); - } - ), - () => this.PageStructureService.showComponentProperties(selectedComponent) + this._confirmDelete(selectedComponent).then( + this._doDelete(componentId), + () => this.PageStructureService.showComponentProperties(selectedComponent) + ); + } + + _doDelete(componentId) { + return () => this.PageStructureService.removeComponentById(componentId) + .then( + ({ oldContainer, newContainer }) => this.DragDropService.replaceContainer(oldContainer, newContainer), + // inform extjs to reset the component properties dialog if deletion is failed + () => this.CmsService.publish('reset-component-properties') ); } ===================================== frontend/src/main/resources/org/onehippo/cms7/channelmanager/channeleditor/ChannelEditor.js ===================================== --- a/frontend/src/main/resources/org/onehippo/cms7/channelmanager/channeleditor/ChannelEditor.js +++ b/frontend/src/main/resources/org/onehippo/cms7/channelmanager/channeleditor/ChannelEditor.js @@ -88,8 +88,8 @@ this._resetComponentPropertiesWindow(); this.hostToIFrame.publish('reload-channel', data); }, - - _resetComponentPropertiesWindow() { + + _resetComponentPropertiesWindow: function() { if (this.componentPropertiesWindow) { this.componentPropertiesWindow.destroy(); } View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/c95e018053aeb8ccf3386c9f827080b1aaacdf0f
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn