<template>
	<el-popover
		class="popover-px-config"
		placement="top"
		:title="$t('Projectx config')"
		v-model="popoverPxConfigVisible"
		@show="onPopoverPxConfigShow"
	>
		<projectx-config ref="pxConfig" @save="onSavePxConfig" :show-bottom-bar="true"/>
		<el-button
			slot="reference"
			size="mini" plain>
			{{$t('Publish config')}}
		</el-button>
	</el-popover>
</template>

<script>
	import ProjectxConfig from "../dialogs/editors/ProjectxConfig";
	export default {
		name: "PxConfigPopover",
		components: {ProjectxConfig},
		data(){
			return {
				popoverPxConfigVisible: false,
			}
		},
		methods: {
			onSavePxConfig() {
				this.popoverPxConfigVisible = false;
				this.$emit('save');
			},
			onPopoverPxConfigShow() {
				this.$refs.pxConfig.edit();
			},
		}
	}
</script>

<style scoped>

</style>