diff --git a/css/area_nav-metabox.less b/css/area_nav-metabox.less index 4bfe95f..972e7a3 100644 --- a/css/area_nav-metabox.less +++ b/css/area_nav-metabox.less @@ -59,6 +59,8 @@ } } &.active > a { + cursor: default; + tab-index: -1; color: #555; background-color: @background_page-header; border-color: transparent; @@ -98,21 +100,24 @@ padding-left: .5em; a { font-size: .78rem; + display: inline-block; + padding-left: 10px; + position: relative; } li { } div.li { position: relative; ::before { - position: relative; - top: -.2em; + position: absolute; + top: .3em; content: ""; display: inline-block; width: 4px; height: 4px; - margin-right: .3rem; - background-color: @color-border; + background-color: #ccc; overflow: hidden; + left: 0; } padding: .15em 0; } diff --git a/js/meta-box.js b/js/meta-box.js new file mode 100644 index 0000000..2a46be8 --- /dev/null +++ b/js/meta-box.js @@ -0,0 +1,41 @@ +(function ($, spc) { + + var toggleTabs = function () { + + var $metaBox = $('#meta-box'), + $tabLinks = $metaBox.find('.meta-tabs').find('a'), + $tabPanels = $metaBox.find('.meta-content').find('.tab-pane'); + + try { + $tabLinks.each(function () { + $(this).on("click", function (e) { + e.preventDefault(); + var $link = $(this), + $panel = $($link.attr('href')); + + //reset + resetTabs(); + + //current state + $link.addClass('active').attr('aria-expanded','true'); + $panel.addClass('active').attr('aria-hidden','false'); + }); + }); + + + } catch (err) { + alert('err'); + } + }, + resetTabs = function($tabLinks,$tabPanels){ + $tabLinks.closest('li').removeClass('active'); + $tabLinks.attr('aria-expanded','false'); + $tabPanels.removeClass('active').attr('aria-hidden','true'); + }; + + $(function () { + toggleTabs(); + }); + +})(jQuery, spc); + diff --git a/js/sidebar-menu.js b/js/sidebar-menu.js index 1a87438..5188479 100644 --- a/js/sidebar-menu.js +++ b/js/sidebar-menu.js @@ -92,7 +92,7 @@ }catch(err){ - alert('err'); + //console.log('err'); } }; diff --git a/script.js b/script.js index 166cae9..2c0a8b8 100755 --- a/script.js +++ b/script.js @@ -26,9 +26,7 @@ /* DOKUWIKI:include js/plugins/do_tasks.js */ - - /* DOKUWIKI:include js/sidebar-menu.js */ - +/* DOKUWIKI:include js/meta-box.js */ diff --git a/tpl/nav-meta-box.php b/tpl/nav-meta-box.php index d6bc634..c7efd6a 100644 --- a/tpl/nav-meta-box.php +++ b/tpl/nav-meta-box.php @@ -1,21 +1,27 @@ +
-
+ -
- -
-
+ + + +