*添加功能:双击title,放大或缩小文本编辑器

This commit is contained in:
jmal 2020-07-21 11:52:37 +08:00
parent 7c01548fbf
commit e0586c1c64
2 changed files with 13 additions and 3 deletions

View File

@ -148,7 +148,7 @@
},
data(){
return{
lightTheme: true,
lightTheme: false,
contentsHide: false,
defalutLanguage: 'redis',
lineWrapping: false,
@ -281,6 +281,7 @@
// 界面的渲染后的初始化工作
this.$nextTick(()=>{
this.onDialogDblClick()
this.dargDialogSize()
this.dragControllerDiv()
this.setTheme()
@ -328,6 +329,16 @@
resize.setAttribute('icon-style', 'show')
}
},
// 双击header放大缩小
onDialogDblClick() {
const dialogHeader = document.querySelector('.simtext-dialog .el-dialog__header')
const that = this
dialogHeader.ondblclick = function (e) {
if(e.target && 'simtext-header-title' === e.target.className){
that.fullScreen()
}
}
},
// 拖动调整窗口大小
dargDialogSize(){
// 右下角
@ -341,7 +352,6 @@
let editorHieght = that.editorHieght
let dialogWidth = that.dialogWidth
document.onmousemove = function (e) {
console.log('onmousemove,onmousemove,onmousemove')
let endX = e.clientX;
let endY = e.clientY;
const moveX = endX - startX

View File

@ -138,7 +138,7 @@ Vue.directive('dialogDrag', {
let x = (document.body.clientWidth - dialogWidth)/2
let y = (document.body.clientHeight - document.body.clientHeight * binding.value.dialogWidthPercent)/2
dragDom.style.transform="translate("+x+"px,"+y+"px)";
dialogHeaderEl.style.cursor = 'move';
//dialogHeaderEl.style.cursor = 'move';
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
// 鼠标按下事件