Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 6 years ago
commit e0e1b8ed94

@ -211,20 +211,35 @@ $(function(){
var FF = !(window.mozInnerScreenX == null); var FF = !(window.mozInnerScreenX == null);
var websshLineHeight = FF ? 19 : 18 var websshLineHeight = FF ? 19 : 18
function throttle(method, delay, duration){
var timer = null, begin = new Date();
return function(){
var context = this, args = arguments, current = new Date();
clearTimeout(timer);
if(current-begin >= duration){
method.apply(context, args);
begin = current;
} else {
timer = setTimeout(function(){
method.apply(context, args);
}, delay);
}
}
}
doc.live('mousemove touchmove',function(e){ doc.live('mousemove touchmove',function(e){
$(".-brother").show();// 代码行的遮罩显示 $(".-brother").show();// 代码行的遮罩显示
if(dragging) { if(dragging) {
clickX = e.pageX || e.originalEvent.touches[0].pageX;; clickX = e.pageX || e.originalEvent.touches[0].pageX;;
if(clickX > leftOffset+0&&clickX<leftOffset+1600) { if(clickX > leftOffset+0&&clickX<leftOffset+1600) {
console.log('resize')
//console.log(1); //console.log(1);
lab.css('left', clickX - 7 - leftOffset + 'px'); lab.css('left', clickX - 7 - leftOffset + 'px');
$("#game_left_contents").width( clickX-leftOffset + 'px'); $("#game_left_contents").width( clickX-leftOffset + 'px');
nextW2 = clickX-leftOffset; nextW2 = clickX-leftOffset;
$("#game_right_contents").width( wrapWidth - nextW2 + 'px'); $("#game_right_contents").width( wrapWidth - nextW2 + 'px');
//console.log(lab.next().width()); //console.log(lab.next().width());
refresh_editor_monaco() throttle(refresh_editor_monaco, 100, 200)()
} else { } else {
lab.css('left', '0px'); lab.css('left', '0px');
} }
@ -246,7 +261,8 @@ $(function(){
var w = $("#games_repository_contents").width(); var w = $("#games_repository_contents").width();
$(".game_webssh").css("min-height", m); $(".game_webssh").css("min-height", m);
$(".game_webssh").css("max-height", m); $(".game_webssh").css("max-height", m);
refresh_editor_monaco(m) throttle(refresh_editor_monaco, 100, 200)(m)
// refresh_editor_monaco(m)
// 火狐下行高为19 // 火狐下行高为19
// CodeRepositoryView.js有同样的计算逻辑用来初始化ssh // CodeRepositoryView.js有同样的计算逻辑用来初始化ssh
var rows = Math.round(m / websshLineHeight); var rows = Math.round(m / websshLineHeight);
@ -1187,6 +1203,8 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
dragging = true; dragging = true;
dragDom = lab; dragDom = lab;
$('#htmlIframe').css('pointer-events', 'none') $('#htmlIframe').css('pointer-events', 'none')
$('#can-drag').show()
lab.hide()
return false; return false;
} }
); );
@ -1206,8 +1224,11 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
}) })
doc.live("mouseup", function(e) { doc.live("mouseup", function(e) {
lab.show()
// 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326 // 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326
if (dragging === true) { if (dragging === true) {
$('#can-drag').hide()
window.editor_CodeMirror && window.editor_CodeMirror.refresh() window.editor_CodeMirror && window.editor_CodeMirror.refresh()
// 使得iframe可以继续捕获事件 // 使得iframe可以继续捕获事件

@ -58,6 +58,14 @@ class MainContent extends Component {
font-family: 微软雅黑,宋体 !important; font-family: 微软雅黑,宋体 !important;
overflow: hidden !important; overflow: hidden !important;
} }
.can-drag {
width: 100%;
height: 100%;
z-index: 100;
position: fixed;
cursor: col-resize;
top: 0px;
}
`}</style> `}</style>
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
<div className="split-panel--first -layout -vertical -flex -relative -flex-basic40" <div className="split-panel--first -layout -vertical -flex -relative -flex-basic40"
@ -67,7 +75,7 @@ class MainContent extends Component {
{/* 左侧任务说明等功能的区域 */} {/* 左侧任务说明等功能的区域 */}
<LeftViewContainer {...newProps}></LeftViewContainer> <LeftViewContainer {...newProps}></LeftViewContainer>
</div> </div>
<div id="can-drag" className="can-drag" style={{display: 'none'}}></div>
<div className="b-label -layout" style={{left: '687px'}}> <div className="b-label -layout" style={{left: '687px'}}>
<div className="resize-helper "> <div className="resize-helper ">
<Button variant="fab" aria-label="Swap" mini onClick={this.onResizeButtonClick}> <Button variant="fab" aria-label="Swap" mini onClick={this.onResizeButtonClick}>

Loading…
Cancel
Save