* Code for adjust title width js .

This commit is contained in:
guofeilong
2023-04-21 14:38:47 +08:00
parent 6ac8651e73
commit e3245bf03c
3 changed files with 32 additions and 4 deletions
+11 -4
View File
@@ -1,15 +1,19 @@
.h-full-adjust {overflow-y: auto; height: calc(100vh - 125px);}
.main-col .block-files .panel-heading {padding-right: 20px;}
.main-col .block-files .panel-heading .panel-title {height: 35px; line-height: 30px;}
.main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 10px; justify-content: space-between;}
/* css for page-title .*/
.main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 10px; justify-content: space-between; width: 100%;}
.main-col .doc-title .info {flex: 0 0 60px;}
.main-col .doc-title .title {margin-right: 10px; line-height: 32px; font-size: 20px;}
.main-col .doc-title .info {flex: 1 1 0;}
.main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;}
.main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;}
.main-col .doc-title .actions {flex: 0 0 165px;}
.main-col .doc-title .actions a + a {margin-left: 0px;}
.main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;}
#content .title {max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.main-col .doc-title .actions a > span {color: #9EA3B0;}
#content .title {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
#mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;}
#content .editor-preview {background: #fff}
#content .CodeMirror{border: none}
@@ -24,10 +28,11 @@
.article-content .info {margin-bottom: 15px; width:100%; overflow:hidden;}
.article-content .info .user-time{margin-right: 4px}
.article-content .info .keywords .label {padding: 2px 8px; color:#18A6FD; border-color:rgba(24, 166, 253, 0.25); height: 18px; line-height:14px; margin-right:4px;}
.article-content {width: 100%; display: inline-block;}
.article-content img {margin: 0;}
.article-content.comment .comment-content {width: 94%;}
/* css for outlineMenu .*/
#outlineMenu {max-width: 200px; overflow-x: auto;}
#outlineMenu .tree li > a {text-overflow: clip;}
.outline-toggle i.icon-angle-right:before {content: "\e314"; cursor: pointer;}
@@ -110,3 +115,5 @@
.exchangeDiffGroup.show-diff .right-dom {display: unset;}
.btn-limit {padding-left: 10px; padding-right: 20px;}
.tree li>.list-toggle {top: 5px; left: -4px;}
.flex-left {display: inline-flex; flex: auto}
+19
View File
@@ -95,6 +95,7 @@ function fullScreen()
}
$('.main-col iframe').css('min-height', $(window).height() + 'px');
adjustPageTitleWidth();
}
/**
@@ -112,6 +113,20 @@ function exitFullScreen()
$('#content .detail').eq(1).removeClass('hidden');
$('.main-col iframe').css('min-height', '380px');
$.cookie('isFullScreen', 0);
adjustPageTitleWidth();
}
/**
* Adjust title width.
*
* @access public
* @return void
*/
function adjustPageTitleWidth()
{
var $titleContent = $('.detail-title.doc-title');
var titleWidth = $titleContent.width() - $titleContent.find('.info').width() - $titleContent.find('.actions').width() - $titleContent.find('#editorBox').width();
$titleContent.find('.flex-left > .title').css('max-width', '0 0' + titleWidth + 'px');
}
document.addEventListener('fullscreenchange', function (e)
@@ -188,10 +203,12 @@ $(function()
$history.addClass('hidden');
$icon.removeClass('text-primary');
}
adjustPageTitleWidth();
}).on('click', '#closeBtn', function()
{
$('#history').addClass('hidden');
$('#hisTrigger').removeClass('text-primary');
adjustPageTitleWidth();
});
$('#outline li.has-list').addClass('open in');
@@ -233,4 +250,6 @@ $(function()
$('#history').find('.btn.pull-right').removeClass('pull-right');
if($('.files-list').length) $('#content .detail-content.article-content').css('height', 'calc(100vh - 300px)');
$('.outline .outline-toggle i.icon-menu-arrow-left').trigger("click");
adjustPageTitleWidth();
}
})
+2
View File
@@ -5,6 +5,7 @@
<div class="cell" id="content">
<div class="detail no-padding">
<div class="detail-title no-padding doc-title">
<div class="flex-left">
<div class="title" title="<?php echo $doc->title;?>">
<?php echo $doc->title;?>
<?php if($doc->deleted):?>
@@ -37,6 +38,7 @@
</div>
</div>
<?php endif;?>
</div>
<div class="actions">
<?php echo html::a("javascript:fullScreen()", '<span class="icon-fullscreen"></span>', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?>
<?php if(common::hasPriv('doc', 'collect')):?>