代码库:提交信息的显示和隐藏
This commit is contained in:
parent
c10799b6d0
commit
fad42414dc
|
@ -107,6 +107,7 @@ function CoderDepot(props){
|
||||||
setMainFlag(true);
|
setMainFlag(true);
|
||||||
setReadOnly(true);
|
setReadOnly(true);
|
||||||
setReadme(result.data.readme);
|
setReadme(result.data.readme);
|
||||||
|
setHide(true);
|
||||||
}
|
}
|
||||||
setTimeout(function(){setIsSpin(false);},500);
|
setTimeout(function(){setIsSpin(false);},500);
|
||||||
}).catch(error=>{setIsSpin(false);})
|
}).catch(error=>{setIsSpin(false);})
|
||||||
|
@ -118,7 +119,7 @@ function CoderDepot(props){
|
||||||
let ele = document.getElementById("ptxt");
|
let ele = document.getElementById("ptxt");
|
||||||
if(ele){
|
if(ele){
|
||||||
let h = ele.offsetHeight;
|
let h = ele.offsetHeight;
|
||||||
if( h > 18 ) setHideBtn(true)
|
if( h > 18 ) setHideBtn(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[projectDetail,lastCommit])
|
},[projectDetail,lastCommit])
|
||||||
|
@ -149,6 +150,7 @@ function CoderDepot(props){
|
||||||
setLastCommitAuthor(c && c.committer);
|
setLastCommitAuthor(c && c.committer);
|
||||||
setMainFlag(false);
|
setMainFlag(false);
|
||||||
setReadOnly(true);
|
setReadOnly(true);
|
||||||
|
setHide(true);
|
||||||
}
|
}
|
||||||
setTimeout(function(){setIsSpin(false);},500)
|
setTimeout(function(){setIsSpin(false);},500)
|
||||||
}).catch(error=>{setIsSpin(false);})
|
}).catch(error=>{setIsSpin(false);})
|
||||||
|
@ -332,7 +334,9 @@ function CoderDepot(props){
|
||||||
lastCommit &&
|
lastCommit &&
|
||||||
<div className="listtablehead">
|
<div className="listtablehead">
|
||||||
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
|
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
|
||||||
<div className={hideBtn && hide ? "ellipsistxt hide" :"ellipsistxt"}><pre id="ptxt">{lastCommit && lastCommit.message}</pre></div>
|
<div className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
|
||||||
|
<pre id="ptxt">{lastCommit && lastCommit.message}</pre>
|
||||||
|
</div>
|
||||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||||
|
|
||||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||||
|
|
|
@ -200,35 +200,39 @@
|
||||||
.listtablehead{
|
.listtablehead{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
border-bottom: 1px solid #d9d9d9;
|
border-bottom: 1px solid #d9d9d9;
|
||||||
padding:7px 20px;
|
padding:7px 20px;
|
||||||
border-radius: 4px 4px 0px 0px;
|
border-radius: 4px 4px 0px 0px;
|
||||||
background-color: #FAFBFC;
|
background-color: #FAFBFC;
|
||||||
.ellipsistxt{
|
.ellipsistxt{
|
||||||
|
margin-top: 6px;
|
||||||
#ptxt{
|
#ptxt{
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow: unset;
|
||||||
|
white-space:pre-wrap; /* css3.0 */
|
||||||
|
white-space:-moz-pre-wrap; /* Firefox */
|
||||||
|
white-space:-pre-wrap; /* Opera 4-6 */
|
||||||
|
white-space:-o-pre-wrap; /* Opera 7 */
|
||||||
|
word-wrap:break-word;
|
||||||
}
|
}
|
||||||
margin-left: 13px;
|
margin-left: 13px;
|
||||||
line-height:18px;
|
line-height:18px;
|
||||||
flex:1;
|
flex:1;
|
||||||
width: 0;
|
width: 0;
|
||||||
color: #666;
|
color: #666;
|
||||||
&>p{
|
&.hidetxt{
|
||||||
word-break:break-all;
|
|
||||||
}
|
|
||||||
&.hide{
|
|
||||||
height: 18px;
|
height: 18px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-right:8px;
|
padding-right:8px;
|
||||||
}
|
&::after{
|
||||||
&.hide::after{
|
position: absolute;
|
||||||
position: absolute;
|
right: 0px;
|
||||||
right: 0px;
|
bottom: 0px;
|
||||||
bottom: 0px;
|
content:"...";
|
||||||
content:"...";
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ellipsis{
|
.ellipsis{
|
||||||
|
|
Loading…
Reference in New Issue