文档界面新增导航目录

This commit is contained in:
fofolee 2020-06-06 20:38:46 +08:00
parent 2a9e7c548f
commit fb509cb39a
5 changed files with 24 additions and 14 deletions

View File

@ -104,7 +104,10 @@ showManual = path => {
$('#manualNavi').autoMenu(); $('#manualNavi').autoMenu();
if ($('h1,h2,h3').length < 10 && $('#manual ul').is(":visible")) { if ($('h1,h2,h3').length < 10 && $('#manual ul').is(":visible")) {
$('.btn-box span').removeClass('icon-minus-sign').addClass('icon-plus-sign') $('.btn-box span').removeClass('icon-minus-sign').addClass('icon-plus-sign')
// $('#manualBody').removeClass('withNaviBar')
$('#manual ul').hide() $('#manual ul').hide()
// } else {
// $('#manualBody').addClass('withNaviBar')
} }
manualSubInput(); manualSubInput();
}); });
@ -242,7 +245,7 @@ utools.onPluginEnter( async ({ code, type, payload }) => {
} else { } else {
manualSubInput(); manualSubInput();
} }
if (type == 'over') { if (type == 'regex') {
utools.setSubInputValue(payload) utools.setSubInputValue(payload)
// showList(payload, index, 300) // showList(payload, index, 300)
} else { } else {

View File

@ -49,7 +49,7 @@ showOptions = async () => {
if (c.code == features.code) { if (c.code == features.code) {
isChecked1 = 'checked'; isChecked1 = 'checked';
isDisabled2 = ''; isDisabled2 = '';
if (c.cmds[c.cmds.length - 1].type == 'over') isChecked2 = 'checked'; if (c.cmds[c.cmds.length - 1].type == 'regex') isChecked2 = 'checked';
break; break;
} }
} }
@ -140,7 +140,7 @@ $("#options").on('change', 'input[type=checkbox]', async function () {
if($(this).prop('checked')){ if($(this).prop('checked')){
featureConf.cmds.push({ featureConf.cmds.push({
"type": "regex", "type": "regex",
"match":"/[a-zA-Z\\.\\_]{2,20}/i", "match":"/^[a-zA-Z._]{2,20}$/i",
"label": featureConf.cmds[0] "label": featureConf.cmds[0]
}); });
} }

View File

@ -107,17 +107,19 @@
var _this = this; var _this = this;
$('#manual').scroll(function() { $('#manual').scroll(function() {
_this.setActive() _this.setActive()
var actived = $('#manual .active') var actived = $('#manual .active').get(0)
if(actived) actived.get(0).scrollIntoView({ behavior: "smooth", block: "center" }); if(actived) actived.scrollIntoView({ behavior: "smooth", block: "center" });
}); });
_this.$element.off() _this.$element.off()
_this.$element.on('click', '.btn-box', function() { _this.$element.on('click', '.btn-box', function() {
if ($(this).find('span').hasClass('icon-minus-sign')) { if ($(this).find('span').hasClass('icon-minus-sign')) {
$(this).find('span').removeClass('icon-minus-sign').addClass('icon-plus-sign'); $(this).find('span').removeClass('icon-minus-sign').addClass('icon-plus-sign');
_this.$element.find('ul').fadeOut(); _this.$element.find('ul').fadeOut();
// $('#manualBody').removeClass('withNaviBar')
} else { } else {
$(this).find('span').removeClass('icon-plus-sign').addClass('icon-minus-sign'); $(this).find('span').removeClass('icon-plus-sign').addClass('icon-minus-sign');
_this.$element.find('ul').fadeIn(); _this.$element.find('ul').fadeIn();
// $('#manualBody').addClass('withNaviBar')
} }
}) })
@ -159,8 +161,8 @@
levelOne: 'h1', //一级标题 levelOne: 'h1', //一级标题
levelTwo: 'h2', //二级标题(暂不支持更多级) levelTwo: 'h2', //二级标题(暂不支持更多级)
levelThree: 'h3', //二级标题(暂不支持更多级) levelThree: 'h3', //二级标题(暂不支持更多级)
width: 200, //容器宽度 width: 220, //容器宽度
height: 400, //容器高度 height: 480, //容器高度
padding: 20, //内部间距 padding: 20, //内部间距
offTop: 100, //滚动切换导航时离顶部的距离 offTop: 100, //滚动切换导航时离顶部的距离

View File

@ -50,8 +50,8 @@ a:focus {
#manualNavi { #manualNavi {
position: fixed; position: fixed;
bottom: 10%; bottom: 0;
right: 5%; right: 15px;
z-index: 1; z-index: 1;
text-align: left; text-align: left;
} }
@ -102,8 +102,8 @@ a:focus {
border: 4px solid #91ba61; border: 4px solid #91ba61;
background: #91ba61; background: #91ba61;
position: absolute; position: absolute;
top: -415px; /* top: 0px; */
left: 245px; left: 235px;
} }
.icon-plus-sign:before, .icon-plus-sign:before,
@ -131,8 +131,8 @@ a:focus {
border: 4px solid #ff5370; border: 4px solid #ff5370;
background: #ff5370; background: #ff5370;
position: absolute; position: absolute;
top: -415px; /* top: 0px; */
left: 245px; left: 235px;
} }
.icon-minus-sign:before { .icon-minus-sign:before {

View File

@ -973,4 +973,9 @@ pre code {
#manual .pl-12 { #manual .pl-12 {
padding-left: 128px !important; padding-left: 128px !important;
} }
/* #manual .withNaviBar {
padding-right: 250px;
transition: 0.2s;
} */