diff --git a/browser/css/cool.css b/browser/css/cool.css index 409169700ac44..013d68a50e863 100644 --- a/browser/css/cool.css +++ b/browser/css/cool.css @@ -329,6 +329,21 @@ body { overflow: hidden; z-index: 990; } + +#sidebar-dock-wrapper.visible { + display: block; + animation: 200ms ease-out appear-from-right; +} + +@keyframes appear-from-right { + from { + transform: translateX(100%); + } + to { + transform: translateX(0); + } +} + #sidebar-panel { padding: 0px; margin: 0px; diff --git a/browser/src/control/Control.Sidebar.ts b/browser/src/control/Control.Sidebar.ts index f1f56905b629a..ab8550cb43f26 100644 --- a/browser/src/control/Control.Sidebar.ts +++ b/browser/src/control/Control.Sidebar.ts @@ -63,11 +63,11 @@ class Sidebar { } isVisible(): boolean { - return $('#sidebar-dock-wrapper').is(':visible'); + return $('#sidebar-dock-wrapper').hasClass('visible'); } closeSidebar() { - $('#sidebar-dock-wrapper').hide(); + $('#sidebar-dock-wrapper').removeClass('visible'); this.map._onResize(); if (!this.map.editorHasFocus()) { @@ -236,8 +236,7 @@ class Sidebar { } this.builder.build(this.container, [sidebarData]); - if (!this.isVisible()) - $('#sidebar-dock-wrapper').show(this.options.animSpeed); + if (!this.isVisible()) $('#sidebar-dock-wrapper').addClass('visible'); this.map.uiManager.setDocTypePref('ShowSidebar', true); } else {