toggler
This commit is contained in:
parent
3569264837
commit
4ab8bced93
4 changed files with 229 additions and 198 deletions
|
@ -27,6 +27,9 @@ nav#dokuwiki__pagetools{
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
ul {
|
ul {
|
||||||
li {
|
li {
|
||||||
|
&:nth-child(3n+3){
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
*{
|
*{
|
||||||
font-size: .8rem;
|
font-size: .8rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
try{
|
try{
|
||||||
var $link = $this.find('#plugin__qc__link'),
|
var $link = $this.find('#plugin__qc__link'),
|
||||||
$container = $this.find('#plugin__qc__wrapper');
|
$container = $this.find('#plugin__qc__wrapper');
|
||||||
|
|
||||||
if($container.length < 1){
|
if($container.length < 1){
|
||||||
$this.remove();
|
$this.remove();
|
||||||
}else{
|
}else{
|
||||||
|
@ -19,6 +20,15 @@
|
||||||
$(this).attr('aria-expanded',!oldState);
|
$(this).attr('aria-expanded',!oldState);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if($container.length > 0){
|
||||||
|
var num = $container.attr('data-errors');
|
||||||
|
if(num){
|
||||||
|
$link.find('.num').empty().append(num);
|
||||||
|
$link.closest('li').removeClass('do_none');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(err){
|
}catch(err){
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
if($menu.length > 0){
|
if($menu.length > 0){
|
||||||
var $toggler = $menu.find('> li.level1 > .li'),
|
var $toggler = $menu.find('> li.level1 > .li'),
|
||||||
$submenu = $menu.find('> li.level1 > ul');
|
$submenu = $menu.find('> li.level1 > ul');
|
||||||
|
|
||||||
if($toggler.length > 0 && $submenu.length > 0){
|
if($toggler.length > 0 && $submenu.length > 0){
|
||||||
|
|
||||||
$toggler.addClass('closed');
|
$toggler.addClass('closed');
|
||||||
|
@ -56,6 +57,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//FIXME: store current nav state with local storage
|
//FIXME: store current nav state with local storage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +68,20 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleMainContent = function(){
|
||||||
|
var $toggler = $('.togglelink.page_main-content').find('a');
|
||||||
|
$toggler.on("click", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var $link = $(this);
|
||||||
|
|
||||||
|
if($('body').hasClass('wide-content')){
|
||||||
|
setDefaultContent();
|
||||||
|
}else{
|
||||||
|
setWideContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
sideMenu = function(){
|
sideMenu = function(){
|
||||||
var $menus = $('.tools').find('.toggle-menu');
|
var $menus = $('.tools').find('.toggle-menu');
|
||||||
|
|
||||||
|
@ -105,6 +121,7 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
mainMenu();
|
mainMenu();
|
||||||
sideMenu();
|
sideMenu();
|
||||||
|
toggleMainContent();
|
||||||
});
|
});
|
||||||
|
|
||||||
} )( jQuery, spc );
|
} )( jQuery, spc );
|
||||||
|
|
|
@ -26,6 +26,7 @@ var $_LANG = {};
|
||||||
setLang();
|
setLang();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} )( jQuery, spc, wikiLang );
|
} )( jQuery, spc, wikiLang );
|
||||||
|
|
||||||
/* DOKUWIKI:include js/plugins/do_tasks.js */
|
/* DOKUWIKI:include js/plugins/do_tasks.js */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue