Skip to content

Commit 07ad239

Browse files
authored
fix admin bar spacer height when context bar is conditionally displayed (#4424)
* fix admin bar spacer height with context bar * changelog * Update CHANGELOG.md
1 parent 17adb34 commit 07ad239

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Copy requires create and edit permission.
2121
* Display a more informative error message when publishing a page because the parent page is not published and the current user has no permission to publish the parent page (while having permission to publish the current one).
2222
* The `content-changed` event for the submit draft action now uses a complete document.
23+
* Fix the context bar overlap on palette for non-admin users that have the permission to modify it.
2324

2425
### Changes
2526

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
:items="userItems"
1717
/>
1818
</div>
19-
<TheAposContextBar @mounted="setSpacer" />
19+
<TheAposContextBar @visibility-changed="setSpacer" />
2020
<component
2121
v-for="bar in bars"
2222
v-bind="bar.props || {}"

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextBar.vue

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import AposAdvisoryLockMixin from 'Modules/@apostrophecms/ui/mixins/AposAdvisory
4242
export default {
4343
name: 'TheAposContextBar',
4444
mixins: [ AposPublishMixin, AposAdvisoryLockMixin ],
45-
emits: [ 'mounted' ],
45+
emits: [ 'visibility-changed' ],
4646
data() {
4747
const query = apos.http.parseQuery(location.search);
4848
// If the URL references a draft, go into draft mode but then clean up the URL
@@ -137,6 +137,11 @@ export default {
137137
watch: {
138138
editMode(newVal) {
139139
window.apos.adminBar.editMode = newVal;
140+
},
141+
contextBarActive() {
142+
this.$nextTick(() => {
143+
this.$emit('visibility-changed');
144+
});
140145
}
141146
},
142147
async mounted() {
@@ -173,9 +178,6 @@ export default {
173178
await this.updateDraftIsEditable();
174179
this.rememberLastBaseContext();
175180
this.published = await this.getPublished();
176-
this.$nextTick(() => {
177-
this.$emit('mounted');
178-
});
179181
180182
apos.util.onReadyAndRefresh(() => {
181183
if (window.apos.adminBar.scrollPosition) {

0 commit comments

Comments
 (0)