优化md编辑时的展示,优化cloudIDE分支跳转,修改PR可跳转IDE的权限等

This commit is contained in:
何童崇 2023-02-02 15:36:16 +08:00
parent aeaac4e933
commit 411b551f36
6 changed files with 11 additions and 11 deletions

View File

@ -831,7 +831,7 @@
if (scrollTop === 0) {
preview.scrollTop(0);
}
else if (scrollTop + height >= cmScroll.scrollHeight - 16) {
else if (scrollTop + height >= cmScroll.scrollHeight - 30) {
preview.scrollTop(preview[0].scrollHeight);
}
else {
@ -1471,7 +1471,6 @@
var preview = $this.preview;
var codeMirror = $this.codeMirror;
var codeView = codeMirror.find(".CodeMirror-scroll");
var height = codeView.height();
var scrollTop = codeView.scrollTop();
var percent = (scrollTop / codeView[0].scrollHeight);
@ -1483,11 +1482,11 @@
var tocMenuHeight = preview.find(".editormd-toc-menu").height();
tocMenuHeight = (!tocMenuHeight) ? 0 : tocMenuHeight;
if (scrollTop === 0) {
preview.scrollTop(0);
}
else if (scrollTop + height >= codeView[0].scrollHeight - 16) {
else if (scrollTop + height >= codeView[0].scrollHeight - 30) {
preview.scrollTop(preview[0].scrollHeight);
}
else {
@ -1595,8 +1594,8 @@
codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function (event) {
var height = $(this).height();
var scrollTop = $(this).scrollTop();
var percent = (scrollTop / $(this)[0].scrollHeight);
var percent = (scrollTop / ($(this)[0].scrollHeight-100));
console.log(percent);
var tocHeight = 0;
preview.find(".markdown-toc-list").each(function () {
@ -1609,7 +1608,7 @@
if (scrollTop === 0) {
preview.scrollTop(0);
}
else if (scrollTop + height >= $(this)[0].scrollHeight - 16) {
else if (scrollTop + height >= $(this)[0].scrollHeight - 30) {
preview.scrollTop(preview[0].scrollHeight);
}
else {

View File

@ -76,7 +76,7 @@ body {
}
/* md多空格 */
.markdown-body p {
margin:10px 0px!important;
/* margin:10px 0px!important; */
font-size: 16px !important;
white-space: pre-wrap;
}

View File

@ -492,7 +492,7 @@ function CoderDepot(props){
}
{
checkIfLogin && checkIfLogin()?
<a className='newBtn' onClick={()=>eventTrack(`/${owner}/${projectsId}/webIDE/tree/${defaultBranch}`)}>Web IDE <div className='newBtnImg'></div></a>
<a className='newBtn' onClick={()=>eventTrack(`/${owner}/${projectsId}/webIDE/tree/${branchName||defaultBranch}`)}>Web IDE <div className='newBtnImg'></div></a>
:
<a className='newBtn' onClick={()=>{showLoginDialog(`/${owner}/${projectsId}`)}}>Web IDE <div className='newBtnImg'></div></a>
}

View File

@ -493,7 +493,7 @@ class MessageCount extends Component {
</Button>
)}
{operate && (
{userLogin && projectDetail && permission && (
<Button
type="blue"
ghost

View File

@ -185,6 +185,7 @@ form .ant-cascader-picker, form .ant-select {
.linesContent > p{
flex:1;
word-break: break-all;
white-space: pre;
}
.linesContent .lines{
display: flex;

View File

@ -1,4 +1,4 @@
.CodeMirror-scroll {
.CodeMirror .CodeMirror-scroll {
overflow: auto !important;
margin-bottom: -30px;
margin-right: -30px;