metabox part 3
This commit is contained in:
parent
d62df8bdbf
commit
92c91ef8b0
5 changed files with 67 additions and 17 deletions
|
@ -59,6 +59,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.active > a {
|
&.active > a {
|
||||||
|
cursor: default;
|
||||||
|
tab-index: -1;
|
||||||
color: #555;
|
color: #555;
|
||||||
background-color: @background_page-header;
|
background-color: @background_page-header;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
|
@ -98,21 +100,24 @@
|
||||||
padding-left: .5em;
|
padding-left: .5em;
|
||||||
a {
|
a {
|
||||||
font-size: .78rem;
|
font-size: .78rem;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 10px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
li {
|
li {
|
||||||
}
|
}
|
||||||
div.li {
|
div.li {
|
||||||
position: relative;
|
position: relative;
|
||||||
::before {
|
::before {
|
||||||
position: relative;
|
position: absolute;
|
||||||
top: -.2em;
|
top: .3em;
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
margin-right: .3rem;
|
background-color: #ccc;
|
||||||
background-color: @color-border;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
padding: .15em 0;
|
padding: .15em 0;
|
||||||
}
|
}
|
||||||
|
|
41
js/meta-box.js
Normal file
41
js/meta-box.js
Normal file
|
@ -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);
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
|
|
||||||
}catch(err){
|
}catch(err){
|
||||||
alert('err');
|
//console.log('err');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,7 @@
|
||||||
|
|
||||||
/* DOKUWIKI:include js/plugins/do_tasks.js */
|
/* DOKUWIKI:include js/plugins/do_tasks.js */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* DOKUWIKI:include js/sidebar-menu.js */
|
/* DOKUWIKI:include js/sidebar-menu.js */
|
||||||
|
/* DOKUWIKI:include js/meta-box.js */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,27 @@
|
||||||
|
<?php
|
||||||
|
if (!defined('DOKU_INC')) die();
|
||||||
|
|
||||||
|
?>
|
||||||
<div class="tab-container">
|
<div class="tab-container">
|
||||||
<ul class="meta-tabs">
|
<ul class="meta-tabs">
|
||||||
<!--<li class="active"><a data-toggle="tab" href="#tab1" aria-expanded="true"><span class="prefix">Sitemap</span><span class="num"></span></a></li>-->
|
|
||||||
<li><a data-toggle="tab" href="#tab1" aria-expanded="false"><span class="prefix">Sitemap</span><span class="num"></span></a></li>
|
<li><a href="#tab1" aria-expanded="false"><span class="prefix">Sitemap</span><span class="num"></span></a></li>
|
||||||
<li><a data-toggle="tab" href="#tab2" aria-expanded="false"><span class="prefix">Tags</span><span class="num"></span></a></li>
|
<?php if ($tags !== null) { ?><li><a href="#tab2" aria-expanded="false"><span class="prefix">Tags</span><span class="num"></span></a></li><?php } ?>
|
||||||
<li><a data-toggle="tab" href="#tab3" aria-expanded="false"><span class="prefix">Jira</span><span class="num"></span></a></li>
|
<li><a href="#tab3" aria-expanded="false"><span class="prefix">Jira</span><span class="num"></span></a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="meta-content">
|
<div class="meta-content">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<div id="tab1" class="tab-pane"> <!-- .active -->
|
<div id="tab1" class="tab-pane" aria-hidden="true">
|
||||||
<?php tpl_toc(); ?>
|
<?php tpl_toc(); ?>
|
||||||
</div>
|
</div>
|
||||||
<div id="tab2" class="tab-pane">
|
<?php if ($tags !== null) { ?>
|
||||||
|
<div id="tab2" class="tab-pane" aria-hidden="true">
|
||||||
</div>
|
<?php $tags->tpl_tags(); ?>
|
||||||
<div id="tab3" class="tab-pane">
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<div id="tab3" class="tab-pane" aria-hidden="true">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue