close #I1BQ5I

This commit is contained in:
mxd 2020-03-17 13:04:38 +08:00
parent 1e4c42e724
commit 4f22a9f363
2 changed files with 17 additions and 7 deletions

View File

@ -27,6 +27,9 @@ html,body{
z-index: 1; z-index: 1;
border-radius: 2px; border-radius: 2px;
overflow-x: hidden; overflow-x: hidden;
writing-mode: vertical-lr;
-webkit-writing-mode: vertical-lr;
-ms-writing-mode: vertical-lr;
} }
.main-container .sidebar-container::-webkit-scrollbar { .main-container .sidebar-container::-webkit-scrollbar {
width: 3px; width: 3px;

View File

@ -89,6 +89,15 @@ function serializeForm(){
}); });
cell.data.set('shape',shape); cell.data.set('shape',shape);
} }
function resizeSlideBar(){
var $dom = $(".sidebar-container");
var height = $dom.height();
var len = $dom.find("img").length;
var totalHeight = len * 46;
var w = Math.ceil(totalHeight / height);
$dom.width(w * 50);
$(".editor-container,.xml-container").css("left",w * 50 + "px");
}
$(function(){ $(function(){
$.ajax({ $.ajax({
url : 'spider/other', url : 'spider/other',
@ -133,10 +142,8 @@ $(function(){
var moveLen = e.clientY; var moveLen = e.clientY;
if(moveLen<250) moveLen = 250; if(moveLen<250) moveLen = 250;
if(moveLen>maxT-150) moveLen = maxT-150; if(moveLen>maxT-150) moveLen = maxT-150;
/*if(box.clientHeight - moveLen < 400 || box.clientHeight - moveLen > 800){
return;
}*/
resize.style.top = moveLen + 'px'; resize.style.top = moveLen + 'px';
resizeSlideBar();
$(".editor-container,.sidebar-container,.xml-container").css('bottom',($('body').height() - moveLen) + 'px'); $(".editor-container,.sidebar-container,.xml-container").css('bottom',($('body').height() - moveLen) + 'px');
$(".properties-container").height(box.clientHeight - moveLen - 5); $(".properties-container").height(box.clientHeight - moveLen - 5);
} }
@ -147,7 +154,8 @@ $(function(){
} }
resize.setCapture && resize.setCapture(); resize.setCapture && resize.setCapture();
return false; return false;
} }
resizeSlideBar();
var templateCache = {}; var templateCache = {};
function loadTemplate(cell,model,callback){ function loadTemplate(cell,model,callback){
serializeForm(); serializeForm();
@ -167,6 +175,7 @@ $(function(){
$(".properties-container").html(html).attr('data-cellid',cell.id); $(".properties-container").html(html).attr('data-cellid',cell.id);
layui.form.render(); layui.form.render();
renderCodeMirror(); renderCodeMirror();
resizeSlideBar();
callback&&callback(); callback&&callback();
}) })
} }
@ -192,9 +201,6 @@ $(function(){
bindToolbarClickAction(editor); bindToolbarClickAction(editor);
//加载图形 //加载图形
loadShapes(editor,$('.sidebar-container')[0]); loadShapes(editor,$('.sidebar-container')[0]);
if($('.sidebar-container')[0].scrollWidth>$('.sidebar-container')[0].clientWidth){
$('.sidebar-container').width($('.sidebar-container').width() + 3);
}
layui.form.on('checkbox',function(e){ layui.form.on('checkbox',function(e){
serializeForm(); serializeForm();
}); });
@ -570,6 +576,7 @@ $(function(){
image.src = shape.image; image.src = shape.image;
image.title = shape.title; image.title = shape.title;
editor.addShape(shape.name,shape.title || 'Label',image,false); editor.addShape(shape.name,shape.title || 'Label',image,false);
resizeSlideBar();
} }
} }
}) })