提交 de66cd3c 编写于 作者: C Catouse

* improve document UI.

上级 92d2f6a2
......@@ -2679,6 +2679,9 @@ body.page-show[data-page-accent="purple"] #pageTogger:hover:after {
background-color: #8666b8;
}
@media (max-width: 767px) {
#navbar .navbar-nav > li > a {
border-radius: 0;
}
#search {
padding: 30px 10px 40px;
}
......@@ -2871,11 +2874,16 @@ body[data-page="basic-theme"] .path-btn > .path-1:after {
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.in > .navbar-right,
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.collapsing > .navbar-right {
float: none!important;
margin-right: 0;
}
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.in > .navbar-nav > li,
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.collapsing > .navbar-nav > li {
float: none;
}
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.in > .navbar-nav > li > a,
body.view-double.compact-mode-in.page-open #navbar .navbar-collapse.collapsing > .navbar-nav > li > a {
border-radius: 0;
}
body.view-double.compact-mode-in.page-open #navbar #compactTogger,
body.view-double.compact-mode-in.page-open #navbar .brand-title {
display: none;
......@@ -3009,8 +3017,8 @@ body[data-page="basic-theme"] .path-btn > .path-1:after {
position: fixed;
bottom: 0;
left: 0;
width: 400px;
background: rgba(255, 255, 255, .5);
width: 340px;
background: rgba(255, 255, 255, .9);
}
body.view-double.compact-mode-in.page-open > footer > .container {
width: 100%!important;
......
此差异已折叠。
......@@ -463,6 +463,8 @@
}, 100));
sectionsShowed = true;
}
$('.text-page-count').text($sections.filter('[data-target="page"]').length);
$('.text-external-count').text($sections.filter('[data-target="external"]').length);
} else if(debug) {
console.error("Display sections failed.");
}
......@@ -506,6 +508,7 @@
scrollToSection($section);
return;
}
$sections.find(':focus').blur();
var isOpened = $section && $section.hasClass('open');
$sections.removeClass(keepOtherOpen ? 'choosed' : 'choosed open');
if($section && $section.hasClass('section')) {
......@@ -1045,7 +1048,7 @@
}
$window.scrollTop(1);
closePage();
if(!$('body').hasClass('view-double')) closePage();
} else if(debug) {
console.error("Query failed with key: ", keys);
}
......@@ -1085,14 +1088,14 @@
}
};
var closePage = function() {
var closePage = function(onlyEvent) {
window['afterPageLoad'] = null;
window['onPageLoad'] = null;
if($.isFunction(window['onPageClose'])) {
window['onPageClose']();
window['onPageClose'] = null;
}
if($body.hasClass('page-open')) {
if(!onlyEvent && $body.hasClass('page-open')) {
var style = $page.data('trans-style');
if(style) {
style['max-height'] = '';
......@@ -1135,7 +1138,7 @@
};
if(valType === 'number') {
expandTopic($pageContent.children('section').eq(topic));
expandTopic($pageContent.children('section').removeClass('hover').eq(topic));
} else if(valType === 'string' && valType.length) {
// highlight element with the id string.
}
......@@ -1282,11 +1285,19 @@
var openPage = function($section, section, topic) {
var pageId = section.chapter + '-' + section.id;
if($body.hasClass('page-open') && pageId === $body.attr('data-page')) {
var isPageOpen = $body.hasClass('page-open');
if(isPageOpen && pageId === $body.attr('data-page')) {
if(debug) console.warn('The page already showed, page will be reload.');
loadPage();
if(topic !== undefined) {
showPageTopic(topic);
} else {
closePage(true);
loadPage(null, '!refresh', true);
}
return;
}
if(isPageOpen) closePage(true);
currentSection = section;
chooseSection($section, false, true);
......@@ -1314,7 +1325,7 @@
$pageAttrs.children('.badge-custom').toggle(!!lib.custom);
$pageAttrs.children('.badge-bootstrap').toggle(lib.source === 'Bootstrap');
$pageAttrs.children('.badge-version').toggle(!!lib.ver).text(lib.ver + '+');
$pageAttrs.children('.badge-party').toggle(!!(lib.source && lib.source !== 'Bootstrap')).attr('href', lib.website || lib.project || 'javascript:;').find('.product-ver').text(lib.pver);
$pageAttrs.children('.badge-party').toggle(!!(lib.source && lib.source !== 'Bootstrap')).attr('href', lib.website || lib.project || 'javascript:;').find('.product-ver').text(lib.pver || '');
var isShowCodeBadage = lib.srcCount > 0 || lib.bundlesCount > 0;
var $codeDropMenu = $pageAttrs.children('.badge-code-dropdown').toggle(isShowCodeBadage);
......@@ -2136,15 +2147,15 @@
query();
}
} else if(code === 37) { // Left
// if(!$body.hasClass('input-query-focus')){
chooseLeftSection();
e.preventDefault();
// }
if(!isDoubleView){
chooseLeftSection();
e.preventDefault();
}
} else if(code === 39) { // Right
// if(!$body.hasClass('input-query-focus')){
chooseRightSection();
e.preventDefault();
// }
if(!isDoubleView){
chooseRightSection();
e.preventDefault();
}
} else if(code === 38) { // Up
if(isPageNotShow || isDoubleView) {
choosePrevSection();
......
此差异已折叠。
......@@ -6987,7 +6987,9 @@
};
var toggleRowClass = function(ele, toggle) {
$rows.filter('[data-index="' + $(ele).closest('tr').data('index') + '"]').toggleClass(checkedClass, !!toggle);
var $tr = $(ele).closest('tr');
if(toggle === undefined) toggle = !$tr.hasClass(checkedClass);
$rows.filter('[data-index="' + $tr.data('index') + '"]').toggleClass(checkedClass, !!toggle);
};
var checkEventPrefix = 'click.zui.datatable.check';
......
此差异已折叠。
......@@ -226,7 +226,7 @@
<footer>
<div class="container">
<hr>
<p class="text-muted"><small>文档版本 <span class="doc-version"><i class="icon icon-spin icon-spinner-indicator"></i></span></small></p>
<p class="text-muted small">文档版本 <span class="doc-version"><i class="icon icon-spin icon-spinner-indicator"></i></span> &nbsp;<span class="text-page-count"></span> 篇内容,<span class="text-external-count"></span> 个外链主题</p>
</div>
</footer>
......@@ -290,7 +290,7 @@
<!-- 增强文档插件 -->
<script async src="assets/prettify/prettify.js"></script>
<script async src="assets/marked/marked.min.js"></script>
<script src="assets/marked/marked.min.js"></script>
<!-- Statistic -->
<div class="hide"><script src="http://s95.cnzz.com/stat.php?id=1253026255&web_id=1253026255"></script></div>
......
......@@ -456,6 +456,8 @@
}, 100));
sectionsShowed = true;
}
$('.text-page-count').text($sections.filter('[data-target="page"]').length);
$('.text-external-count').text($sections.filter('[data-target="external"]').length);
} else if(debug) {
console.error("Display sections failed.");
}
......@@ -499,6 +501,7 @@
scrollToSection($section);
return;
}
$sections.find(':focus').blur();
var isOpened = $section && $section.hasClass('open');
$sections.removeClass(keepOtherOpen ? 'choosed' : 'choosed open');
if($section && $section.hasClass('section')) {
......@@ -1038,7 +1041,7 @@
}
$window.scrollTop(1);
closePage();
if(!$('body').hasClass('view-double')) closePage();
} else if(debug) {
console.error("Query failed with key: ", keys);
}
......@@ -1078,14 +1081,14 @@
}
};
var closePage = function() {
var closePage = function(onlyEvent) {
window['afterPageLoad'] = null;
window['onPageLoad'] = null;
if($.isFunction(window['onPageClose'])) {
window['onPageClose']();
window['onPageClose'] = null;
}
if($body.hasClass('page-open')) {
if(!onlyEvent && $body.hasClass('page-open')) {
var style = $page.data('trans-style');
if(style) {
style['max-height'] = '';
......@@ -1128,7 +1131,7 @@
};
if(valType === 'number') {
expandTopic($pageContent.children('section').eq(topic));
expandTopic($pageContent.children('section').removeClass('hover').eq(topic));
} else if(valType === 'string' && valType.length) {
// highlight element with the id string.
}
......@@ -1275,11 +1278,19 @@
var openPage = function($section, section, topic) {
var pageId = section.chapter + '-' + section.id;
if($body.hasClass('page-open') && pageId === $body.attr('data-page')) {
var isPageOpen = $body.hasClass('page-open');
if(isPageOpen && pageId === $body.attr('data-page')) {
if(debug) console.warn('The page already showed, page will be reload.');
loadPage();
if(topic !== undefined) {
showPageTopic(topic);
} else {
closePage(true);
loadPage(null, '!refresh', true);
}
return;
}
if(isPageOpen) closePage(true);
currentSection = section;
chooseSection($section, false, true);
......@@ -1307,7 +1318,7 @@
$pageAttrs.children('.badge-custom').toggle(!!lib.custom);
$pageAttrs.children('.badge-bootstrap').toggle(lib.source === 'Bootstrap');
$pageAttrs.children('.badge-version').toggle(!!lib.ver).text(lib.ver + '+');
$pageAttrs.children('.badge-party').toggle(!!(lib.source && lib.source !== 'Bootstrap')).attr('href', lib.website || lib.project || 'javascript:;').find('.product-ver').text(lib.pver);
$pageAttrs.children('.badge-party').toggle(!!(lib.source && lib.source !== 'Bootstrap')).attr('href', lib.website || lib.project || 'javascript:;').find('.product-ver').text(lib.pver || '');
var isShowCodeBadage = lib.srcCount > 0 || lib.bundlesCount > 0;
var $codeDropMenu = $pageAttrs.children('.badge-code-dropdown').toggle(isShowCodeBadage);
......@@ -2129,15 +2140,15 @@
query();
}
} else if(code === 37) { // Left
// if(!$body.hasClass('input-query-focus')){
chooseLeftSection();
e.preventDefault();
// }
if(!isDoubleView){
chooseLeftSection();
e.preventDefault();
}
} else if(code === 39) { // Right
// if(!$body.hasClass('input-query-focus')){
chooseRightSection();
e.preventDefault();
// }
if(!isDoubleView){
chooseRightSection();
e.preventDefault();
}
} else if(code === 38) { // Up
if(isPageNotShow || isDoubleView) {
choosePrevSection();
......
......@@ -1974,6 +1974,7 @@ body.page-show {
}
@media (max-width: 767px) {
#navbar .navbar-nav > li > a {border-radius: 0}
#search {padding: 30px 10px 40px;}
#ad {
margin-top: -20px;
......@@ -2144,11 +2145,15 @@ body[data-page="basic-theme"] {
}
> .navbar-right {
float: none!important;
margin-right: 0;
}
display: block!important;
width: 140px;
> .navbar-nav > li {
float: none;
> a {
border-radius: 0;
}
}
}
}
......@@ -2237,8 +2242,8 @@ body[data-page="basic-theme"] {
position: fixed;
left: 0;
bottom: 0;
width: 400px;
background: rgba(255,255,255,.5);
width: 340px;
background: rgba(255,255,255,.9);
> .container {width: 100%!important;}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册