Skip to content

Commit

Permalink
Restore tab selection on campaign page on reload.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 29, 2023
1 parent 49bbf92 commit db17fa1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/src/views/Campaign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ import Editor from '../components/Editor.vue';
import ListSelector from '../components/ListSelector.vue';
import Media from './Media.vue';
const TABS = ['campaign', 'content', 'archive'];
export default Vue.extend({
components: {
ListSelector,
Expand All @@ -286,7 +284,7 @@ export default Vue.extend({
isHeadersVisible: false,
isAttachFieldVisible: false,
isAttachModalOpen: false,
activeTab: 0,
activeTab: 'campaign',
data: {},
Expand Down Expand Up @@ -361,13 +359,15 @@ export default Vue.extend({
|| this.data.contentType !== this.form.content.contentType;
},
onTab(t) {
const tab = TABS[t];
onTab(tab) {
if (tab === 'content' && window.tinymce && window.tinymce.editors.length > 0) {
this.$nextTick(() => {
window.tinymce.editors[0].focus();
});
}
// this.$router.replace({ hash: `#${tab}` });
window.history.replaceState({}, '', `#${tab}`);
},
onFillArchiveMeta() {
Expand Down Expand Up @@ -662,8 +662,8 @@ export default Vue.extend({
// Fetch campaign.
if (this.isEditing) {
this.getCampaign(id).then(() => {
if (this.$route.hash === '#content') {
this.activeTab = 1;
if (this.$route.hash !== '') {
this.activeTab = this.$route.hash.replace('#', '');
}
});
} else {
Expand Down

0 comments on commit db17fa1

Please sign in to comment.