diff --git a/css/publicshare.css b/css/publicshare.css index d99ee9831..ccacb8ca2 100644 --- a/css/publicshare.css +++ b/css/publicshare.css @@ -67,21 +67,3 @@ * from the top padding of the second element). */ padding-bottom: 8px; } - - - -#talk-sidebar-trigger { - width: 44px; - height: 44px; - - background-color: transparent; - border-color: transparent; - - opacity: 0.6; -} - -#talk-sidebar-trigger:hover, -#talk-sidebar-trigger:focus, -#talk-sidebar-trigger:active { - opacity: 1; -} diff --git a/src/PublicShareSidebarTrigger.vue b/src/PublicShareSidebarTrigger.vue new file mode 100644 index 000000000..99a049ede --- /dev/null +++ b/src/PublicShareSidebarTrigger.vue @@ -0,0 +1,73 @@ + + + + + + + diff --git a/src/mainPublicShareSidebar.js b/src/mainPublicShareSidebar.js index f2ba41d77..ee4f468be 100644 --- a/src/mainPublicShareSidebar.js +++ b/src/mainPublicShareSidebar.js @@ -21,6 +21,7 @@ import Vue from 'vue' import VueObserveVisibility from 'vue-observe-visibility' import PublicShareSidebar from './PublicShareSidebar.vue' +import PublicShareSidebarTrigger from './PublicShareSidebarTrigger.vue' import './init.js' // Store @@ -98,10 +99,6 @@ if (window.innerWidth > 1111) { function addTalkSidebarTrigger() { const talkSidebarTriggerElement = document.createElement('button') talkSidebarTriggerElement.setAttribute('id', 'talk-sidebar-trigger') - talkSidebarTriggerElement.setAttribute('class', 'icon-menu-people-white') - talkSidebarTriggerElement.addEventListener('click', () => { - sidebarState.isOpen = !sidebarState.isOpen - }) // The ".header-right" element may not exist in the public share page if // there are no header actions. @@ -112,6 +109,17 @@ function addTalkSidebarTrigger() { } document.querySelector('.header-right').appendChild(talkSidebarTriggerElement) + + const talkSidebarTriggerVm = new Vue({ + propsData: { + sidebarState, + }, + ...PublicShareSidebarTrigger, + }) + talkSidebarTriggerVm.$on('click', () => { + sidebarState.isOpen = !sidebarState.isOpen + }) + talkSidebarTriggerVm.$mount('#talk-sidebar-trigger') } addTalkSidebarTrigger()