Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 模板全局变量批量编辑 #98 #99

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/frontend/src/components/jb-edit/textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

const calcLength = () => {
const text = this.newVal.slice(0, realLength);
$el.innerText = text;
$el.innerText = `${text} 展开展开`;
Promise.resolve()
.then(() => {
realHeight = $el.getBoundingClientRect().height;
Expand All @@ -213,7 +213,7 @@
setTimeout(() => {
this.renderLength = 0;
if (realHeight > lineHeight) {
this.renderLength = realLength - 7;
this.renderLength = realLength - 4;
}
this.$refs.textWraper.removeChild($el);
});
Expand Down Expand Up @@ -337,12 +337,13 @@
color: #3a84ff;
white-space: nowrap;
cursor: pointer;
user-select: none;
}
}

.render-text-box {
position: relative;
max-width: calc(100% - 25px);
width: 100%;
overflow: hidden;
line-height: 24px;
white-space: pre-wrap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
const variable = new GlobalVariableModel(variableData);
variableList.splice(index, 1, variable);
this.variableList = variableList;
window.changeAlert = true;
},
/**
* @desc 删除指定索引的变量
Expand All @@ -121,13 +122,15 @@
variableList.splice(index, 1);
}
this.variableList = variableList;
window.changeAlert = true;
},
/**
* @desc 在指定索引位置添加一个新变量
* @param {Number} index 编辑的变量索引
*/
handleAppendVariable (index) {
this.variableList.splice(index + 1, 0, createVariable());
window.changeAlert = true;
},
/**
* @desc 提交编辑
Expand Down