From f55e22d5fe3f9121b7ed81d0c3f8c6a094dff45c Mon Sep 17 00:00:00 2001 From: Konstantin Chernenko Date: Wed, 24 May 2023 17:08:18 +0200 Subject: update mobile view and some bugs (#2836) * Fix dark theme bugs: mobile TOC is visible on 1px and has white background, menu icon is black * Refactoring css styles for header controls * Change header responsive layout * Change header responsive layout * Fix scrollable columns for any header size * Remove main content mobile spacing * Change style for platform filters and labels * Fix: add burger icon into dist * Fix: long code token in mobile view * Fix: color in filter selector * Fix: long token in keyValue for desktop * Fix: add spacing for iPad Mini * Fix: dropdown for multiple versions * update platform brand colors * Fix: sample spacing, blockquote, playground initialize * Safari fix outline for platform tags * Fix non-js main content for better SEO * Fix outline for safari browser * Add consistent vertical spacing for header. It should normalize subpixel artifacts and centred content. * Update manual for custom logo * Add comment for playground * Hide copy button for non-js user * fix; use google fonts * feat; change style for platform in platform-tags * Revert Inter as defult font * Add breaks for CONSTANTS * incorrect non-js script position * less specific selector for article links --- .../main/resources/dokka/scripts/platform-content-handler.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js') diff --git a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js index 1f99ba1f..88d4d71a 100644 --- a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js +++ b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js @@ -82,7 +82,7 @@ const samplesAreEnabled = () => { const initHidingLeftNavigation = () => { - document.getElementById("leftToggler").onclick = function (event) { + document.getElementById("menu-toggle").onclick = function (event) { //Events need to be prevented from bubbling since they will trigger next handler event.preventDefault(); event.stopPropagation(); @@ -329,6 +329,16 @@ function refreshFiltering() { refreshFilterButtons() refreshPlatformTabs() refreshNoContentNotification() + refreshPlaygroundSamples() +} + +function refreshPlaygroundSamples() { + document.querySelectorAll('code.runnablesample').forEach(node => { + const playground = node.KotlinPlayground; + /* Some samples may be hidden by filter, they have 0px height for visible code area + * after rendering. Call this method for re-calculate code area height */ + playground && playground.view.codemirror.refresh(); + }); } function refreshNoContentNotification() { -- cgit