*添加功能:双击title,放大或缩小文本编辑器
This commit is contained in:
parent
7c01548fbf
commit
e0586c1c64
@ -148,7 +148,7 @@
|
|||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
lightTheme: true,
|
lightTheme: false,
|
||||||
contentsHide: false,
|
contentsHide: false,
|
||||||
defalutLanguage: 'redis',
|
defalutLanguage: 'redis',
|
||||||
lineWrapping: false,
|
lineWrapping: false,
|
||||||
@ -281,6 +281,7 @@
|
|||||||
|
|
||||||
// 界面的渲染后的初始化工作
|
// 界面的渲染后的初始化工作
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
|
this.onDialogDblClick()
|
||||||
this.dargDialogSize()
|
this.dargDialogSize()
|
||||||
this.dragControllerDiv()
|
this.dragControllerDiv()
|
||||||
this.setTheme()
|
this.setTheme()
|
||||||
@ -328,6 +329,16 @@
|
|||||||
resize.setAttribute('icon-style', 'show')
|
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(){
|
dargDialogSize(){
|
||||||
// 右下角
|
// 右下角
|
||||||
@ -341,7 +352,6 @@
|
|||||||
let editorHieght = that.editorHieght
|
let editorHieght = that.editorHieght
|
||||||
let dialogWidth = that.dialogWidth
|
let dialogWidth = that.dialogWidth
|
||||||
document.onmousemove = function (e) {
|
document.onmousemove = function (e) {
|
||||||
console.log('onmousemove,onmousemove,onmousemove')
|
|
||||||
let endX = e.clientX;
|
let endX = e.clientX;
|
||||||
let endY = e.clientY;
|
let endY = e.clientY;
|
||||||
const moveX = endX - startX
|
const moveX = endX - startX
|
||||||
|
|||||||
@ -138,7 +138,7 @@ Vue.directive('dialogDrag', {
|
|||||||
let x = (document.body.clientWidth - dialogWidth)/2
|
let x = (document.body.clientWidth - dialogWidth)/2
|
||||||
let y = (document.body.clientHeight - document.body.clientHeight * binding.value.dialogWidthPercent)/2
|
let y = (document.body.clientHeight - document.body.clientHeight * binding.value.dialogWidthPercent)/2
|
||||||
dragDom.style.transform="translate("+x+"px,"+y+"px)";
|
dragDom.style.transform="translate("+x+"px,"+y+"px)";
|
||||||
dialogHeaderEl.style.cursor = 'move';
|
//dialogHeaderEl.style.cursor = 'move';
|
||||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||||
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
|
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
|
||||||
// 鼠标按下事件
|
// 鼠标按下事件
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user