|
@@ -24,6 +24,7 @@ function NodeCheck(dom,className){
|
|
|
const classList = getAllParentNodes(dom).map(d=>d.className)
|
|
|
return classList.includes(className)
|
|
|
}
|
|
|
+let __click__title__outside = null
|
|
|
export default{
|
|
|
data(){
|
|
|
return {
|
|
@@ -67,9 +68,10 @@ export default{
|
|
|
}
|
|
|
},
|
|
|
'click-title-outside':{
|
|
|
- bind(el,binding){
|
|
|
+ bind(el,binding,vnode){
|
|
|
const clickHandle = (e)=>{
|
|
|
//点击标题区域和标题设置之外的地方,退出标题编辑模式
|
|
|
+ if(!vnode.context.isEditTitle) return
|
|
|
if(NodeCheck(e.target,'title-edit-box')||NodeCheck(e.target,'title-editor')){
|
|
|
return false
|
|
|
}
|
|
@@ -77,11 +79,11 @@ export default{
|
|
|
binding.value(e)
|
|
|
}
|
|
|
}
|
|
|
- el.__click__title__outside = clickHandle
|
|
|
+ __click__title__outside = clickHandle
|
|
|
document.addEventListener('click',clickHandle)
|
|
|
},
|
|
|
unbind(el,binding,vnode){
|
|
|
- document.removeEventListener('click',el.__click__title__outside)
|
|
|
+ document.removeEventListener('click',__click__title__outside)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -114,6 +116,14 @@ export default{
|
|
|
this.currentIndex = index
|
|
|
}
|
|
|
})
|
|
|
+ let height = $('.ppt-editor-item')[0].offsetHeight
|
|
|
+ const index = this.currentIndex
|
|
|
+ //pptEditor的滚动条动画
|
|
|
+ this.$refs.pptEditor.scrollTo({
|
|
|
+ top:height*index,
|
|
|
+ left:0,
|
|
|
+ behavior: 'smooth'
|
|
|
+ })
|
|
|
}
|
|
|
//this.isEditTitle = !this.isEditTitle
|
|
|
this.isEditTitle = true
|