be-fe / iSlider

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App
http://be-fe.github.io/iSlider/
MIT License
1.66k stars 448 forks source link

lock锁定后unlock解锁无效 #410

Closed shaww855 closed 7 years ago

shaww855 commented 7 years ago

lock

this.hold() ,this._locking = !0

unlock

this._locking=!1

hold

this._holding = !0

unhold

this._holding = !1,this.unlock()

导致现在lock()锁定后,用unhold()才能解锁

shinate commented 7 years ago

确实是这样设计的,因为lock的权重高于并包含了hold。 实现上实际是:“用一个双层的箱子装了东西,但是要一层一层的拆开”,正向和逆向并不是对应的,方法名... 比较容易混淆😅

手势限定/解除手势限定:
hold()
=>
unhold()

锁定/解除锁定:
lock()
=>
unhold()

锁定/解除锁定并保留手势限定:
lock()
=>
unlock()