Skip to content

Commit

Permalink
feat: Extra margin to remove when CMS portlets are not displayed - ME…
Browse files Browse the repository at this point in the history
…ED-2953-Meeds-io/MIPs#103 (#3205)

Prior to this change, When we toggle between show/hide of the preview mode in the public page, an extra margin in displayed when the app is hidden. 
This change allows to remove extra margin when app is hidden.
  • Loading branch information
SaraBoutej authored and exo-swf committed Nov 22, 2023
1 parent d0a6508 commit 4d0f04a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ export default {
return !this.previewMode && this.$root.canEdit;
},
},
watch: {
canView() {
if (this.canView) {
this.$el.parentElement.closest('.PORTLET-FRAGMENT').classList.remove('hidden');
} else {
this.$el.parentElement.closest('.PORTLET-FRAGMENT').classList.add('hidden');
}
}
},
created() {
document.addEventListener('cms-preview-mode', this.switchToPreview);
document.addEventListener('cms-edit-mode', this.switchToEdit);
Expand Down

0 comments on commit 4d0f04a

Please sign in to comment.