PAL设计器画布大小自适应
This commit is contained in:
parent
e79af0c654
commit
a2c539dc2d
@ -1955,7 +1955,7 @@ function saveInputContent(obj,value) {
|
|||||||
if ($(obj).attr("inputType") == "number") {
|
if ($(obj).attr("inputType") == "number") {
|
||||||
var val = $(obj).val();
|
var val = $(obj).val();
|
||||||
if (/\D/.test(val)) {
|
if (/\D/.test(val)) {
|
||||||
$.simpleAlert("此处只能输入数字", "info", 2000);
|
$.simpleAlert("此处只能输入数字", "warning", 2000);
|
||||||
//$("#simplealert>.msg").css("top", "15px");
|
//$("#simplealert>.msg").css("top", "15px");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2364,6 +2364,19 @@ Designer.events.addEventListener("linkerCreated", function(linker) {
|
|||||||
* 图形创建后重写
|
* 图形创建后重写
|
||||||
*/
|
*/
|
||||||
Designer.events.addEventListener("created", function(shape) {
|
Designer.events.addEventListener("created", function(shape) {
|
||||||
|
let shapePosition = shape.props
|
||||||
|
let pageSize = Model.define.page
|
||||||
|
if (shapePosition.x + shapePosition.w > pageSize.width - pageSize.padding) {
|
||||||
|
Designer.setPageStyle({
|
||||||
|
width: shapePosition.x + shapePosition.w + pageSize.padding + 10,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (shapePosition.y + shapePosition.h > pageSize.height - pageSize.padding) {
|
||||||
|
Designer.setPageStyle({
|
||||||
|
height: shapePosition.y + shapePosition.h + pageSize.padding + 10,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (Designer.status == "demo" && !demoCreatedTiped) {
|
if (Designer.status == "demo" && !demoCreatedTiped) {
|
||||||
UI.showStartStep("created", $("#" + shape.id));
|
UI.showStartStep("created", $("#" + shape.id));
|
||||||
demoCreatedTiped = true;
|
demoCreatedTiped = true;
|
||||||
|
|||||||
@ -1165,6 +1165,21 @@ var Designer = {
|
|||||||
Designer.op.hideSnapLine();
|
Designer.op.hideSnapLine();
|
||||||
Utils.showLinkerCursor();
|
Utils.showLinkerCursor();
|
||||||
Utils.showLinkerControls();
|
Utils.showLinkerControls();
|
||||||
|
var selectedShape = Utils.getSelected()[0];
|
||||||
|
if (selectedShape) {
|
||||||
|
var shapePosition = selectedShape.props;
|
||||||
|
var pageSize = Model.define.page;
|
||||||
|
if (shapePosition.x + shapePosition.w > pageSize.width - pageSize.padding){
|
||||||
|
Designer.setPageStyle({
|
||||||
|
width: shapePosition.x + shapePosition.w + pageSize.padding + 10
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (shapePosition.y + shapePosition.h > pageSize.height - pageSize.padding){
|
||||||
|
Designer.setPageStyle({
|
||||||
|
height: shapePosition.y + shapePosition.h + pageSize.padding + 10
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isAutoSave == "0") {
|
if (isAutoSave == "0") {
|
||||||
$("#saving_tip").css("color", "rgb(255, 0, 0)");
|
$("#saving_tip").css("color", "rgb(255, 0, 0)");
|
||||||
$("#saving_tip").text("文件已修改,未保存");
|
$("#saving_tip").text("文件已修改,未保存");
|
||||||
@ -1519,6 +1534,21 @@ var Designer = {
|
|||||||
Designer.op.resetState();
|
Designer.op.resetState();
|
||||||
S.unbind("mousemove.resize");
|
S.unbind("mousemove.resize");
|
||||||
$(document).unbind("mouseup.resize");
|
$(document).unbind("mouseup.resize");
|
||||||
|
var selectedShape = Utils.getSelected()[0];
|
||||||
|
if (selectedShape) {
|
||||||
|
var shapePosition = selectedShape.props;
|
||||||
|
var pageSize = Model.define.page;
|
||||||
|
if (shapePosition.x + shapePosition.w > pageSize.width - pageSize.padding){
|
||||||
|
Designer.setPageStyle({
|
||||||
|
width: shapePosition.x + shapePosition.w + pageSize.padding + 10
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (shapePosition.y + shapePosition.h > pageSize.height - pageSize.padding){
|
||||||
|
Designer.setPageStyle({
|
||||||
|
height: shapePosition.y + shapePosition.h + pageSize.padding + 10
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Designer.op.hideTip();
|
Designer.op.hideTip();
|
||||||
Utils.showLinkerCursor();
|
Utils.showLinkerCursor();
|
||||||
Designer.op.hideSnapLine()
|
Designer.op.hideSnapLine()
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user