added EE to intro
This commit is contained in:
56
buildoz.js
56
buildoz.js
@@ -247,3 +247,59 @@ class BZtoggler extends Buildoz {
|
||||
}
|
||||
}
|
||||
Buildoz.define('toggler', BZtoggler)
|
||||
|
||||
|
||||
|
||||
class BZslidePane extends Buildoz {
|
||||
|
||||
constructor(){
|
||||
super()
|
||||
this.open = false
|
||||
this.defaultAttrs = {
|
||||
side: 'bottom'
|
||||
}
|
||||
this.dragMove = this.dragMove.bind(this)
|
||||
this.dragEnd = this.dragEnd.bind(this)
|
||||
}
|
||||
|
||||
connectedCallback(){
|
||||
super.connectedCallback()
|
||||
this.handle = document.createElement('div')
|
||||
this.handle.classList.add('handle')
|
||||
this.handle.classList.add(this.getBZAttribute('side'))
|
||||
this.prepend(this.handle)
|
||||
this.handle.addEventListener('pointerdown', this.dragStart.bind(this))
|
||||
}
|
||||
|
||||
dragStart(evt){
|
||||
evt.target.setPointerCapture(evt.pointerId)
|
||||
this.dragStartX = evt.clientX
|
||||
this.dragStartY = evt.clientY
|
||||
this.handle.addEventListener('pointermove', this.dragMove)
|
||||
this.handle.addEventListener('pointerup', this.dragEnd)
|
||||
}
|
||||
|
||||
dragMove(evt){
|
||||
const dx = evt.clientX - this.dragStartX
|
||||
const dy = evt.clientY - this.dragStartY
|
||||
|
||||
switch(this.getAttribute('side')){
|
||||
case 'top':
|
||||
break
|
||||
case 'bottom':
|
||||
break
|
||||
case 'left':
|
||||
break
|
||||
case'right':
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
dragEnd(evt){
|
||||
evt.target.releasePointerCapture(evt.pointerId)
|
||||
this.handle.removeEventListener('pointermove', this.dragMove)
|
||||
this.handle.removeEventListener('pointerup', this.dragEnd)
|
||||
}
|
||||
}
|
||||
Buildoz.define('slidepane', BZslidePane)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user