优化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) { if (scrollTop === 0) {
preview.scrollTop(0); preview.scrollTop(0);
} }
else if (scrollTop + height >= cmScroll.scrollHeight - 16) { else if (scrollTop + height >= cmScroll.scrollHeight - 30) {
preview.scrollTop(preview[0].scrollHeight); preview.scrollTop(preview[0].scrollHeight);
} }
else { else {
@ -1471,7 +1471,6 @@
var preview = $this.preview; var preview = $this.preview;
var codeMirror = $this.codeMirror; var codeMirror = $this.codeMirror;
var codeView = codeMirror.find(".CodeMirror-scroll"); var codeView = codeMirror.find(".CodeMirror-scroll");
var height = codeView.height(); var height = codeView.height();
var scrollTop = codeView.scrollTop(); var scrollTop = codeView.scrollTop();
var percent = (scrollTop / codeView[0].scrollHeight); var percent = (scrollTop / codeView[0].scrollHeight);
@ -1487,7 +1486,7 @@
if (scrollTop === 0) { if (scrollTop === 0) {
preview.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); preview.scrollTop(preview[0].scrollHeight);
} }
else { else {
@ -1595,8 +1594,8 @@
codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function (event) { codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function (event) {
var height = $(this).height(); var height = $(this).height();
var scrollTop = $(this).scrollTop(); var scrollTop = $(this).scrollTop();
var percent = (scrollTop / $(this)[0].scrollHeight); var percent = (scrollTop / ($(this)[0].scrollHeight-100));
console.log(percent);
var tocHeight = 0; var tocHeight = 0;
preview.find(".markdown-toc-list").each(function () { preview.find(".markdown-toc-list").each(function () {
@ -1609,7 +1608,7 @@
if (scrollTop === 0) { if (scrollTop === 0) {
preview.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); preview.scrollTop(preview[0].scrollHeight);
} }
else { else {

View File

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

View File

@ -492,7 +492,7 @@ function CoderDepot(props){
} }
{ {
checkIfLogin && checkIfLogin()? 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> <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> </Button>
)} )}
{operate && ( {userLogin && projectDetail && permission && (
<Button <Button
type="blue" type="blue"
ghost ghost

View File

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

View File

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