|
1 | 1 | /*! |
2 | | - * he-tree-vue v2.0.11.beta |
| 2 | + * he-tree-vue v2.0.11.beta-2 |
3 | 3 | * (c) phphe <phphe@outlook.com> (https://github.com/phphe) |
4 | 4 | * Homepage: https://he-tree-vue.phphe.com |
5 | 5 | * Released under the MIT License. |
|
1864 | 1864 | return parents; |
1865 | 1865 | } |
1866 | 1866 | } |
1867 | | - /* scroll to a positon with duration |
1868 | | - from https://gist.github.com/andjosh/6764939 |
1869 | | - interface options{ |
1870 | | - x: number // nullable. don't scroll horizontally when null |
1871 | | - y: number // nullable. don't scroll vertically when null |
1872 | | - duration: number // default 0 |
1873 | | - element: Element // default is the top scrollable element. |
1874 | | - beforeEveryFrame: (count: number) => boolean|void // call before requestAnimationFrame execution. return false to stop |
1875 | | - } |
1876 | | - return stop |
| 1867 | + /* scroll to a positon with duration |
| 1868 | + from https://gist.github.com/andjosh/6764939 |
| 1869 | + interface options{ |
| 1870 | + x: number // nullable. don't scroll horizontally when null |
| 1871 | + y: number // nullable. don't scroll vertically when null |
| 1872 | + duration: number // default 0 |
| 1873 | + element: Element // default is the top scrollable element. |
| 1874 | + beforeEveryFrame: (count: number) => boolean|void // call before requestAnimationFrame execution. return false to stop |
| 1875 | + } |
| 1876 | + return stop |
1877 | 1877 | */ |
1878 | 1878 |
|
1879 | 1879 |
|
|
2950 | 2950 |
|
2951 | 2951 | return arr2; |
2952 | 2952 | } |
2953 | | - /* Default export, a function. |
2954 | | - ```js |
2955 | | - import draggableHelper from 'draggable-helper' |
2956 | | - draggableHelper(listenerElement, options) |
2957 | | - ``` |
2958 | | - Arguments: |
2959 | | - listenerElement: HTMLElement. The element to bind mouse and touch event listener. |
2960 | | - options: Options. Optional. |
| 2953 | + /* Default export, a function. |
| 2954 | + ```js |
| 2955 | + import draggableHelper from 'draggable-helper' |
| 2956 | + draggableHelper(listenerElement, options) |
| 2957 | + ``` |
| 2958 | + Arguments: |
| 2959 | + listenerElement: HTMLElement. The element to bind mouse and touch event listener. |
| 2960 | + options: Options. Optional. |
2961 | 2961 | */ |
2962 | 2962 |
|
2963 | | - /* 默认导出, 一个方法. |
2964 | | - ```js |
2965 | | - import draggableHelper from 'draggable-helper' |
2966 | | - draggableHelper(listenerElement, options) |
2967 | | - ``` |
2968 | | - 参数: |
2969 | | - listenerElement: HTMLElement. 绑定鼠标和触摸事件监听器的HTML元素. |
2970 | | - options: Options. 可选. |
| 2963 | + /* 默认导出, 一个方法. |
| 2964 | + ```js |
| 2965 | + import draggableHelper from 'draggable-helper' |
| 2966 | + draggableHelper(listenerElement, options) |
| 2967 | + ``` |
| 2968 | + 参数: |
| 2969 | + listenerElement: HTMLElement. 绑定鼠标和触摸事件监听器的HTML元素. |
| 2970 | + options: Options. 可选. |
2971 | 2971 | */ |
2972 | 2972 |
|
2973 | 2973 |
|
|
3214 | 3214 |
|
3215 | 3215 | backupAttr(movedElement, 'class'); |
3216 | 3216 | addClass(movedElement, opt.draggingClassName); |
3217 | | - /* |
3218 | | - check if the changed position is expected and correct it. about stacking context. |
3219 | | - 当某父元素使用了transform属性时, fixed不再以窗口左上角为坐标. 以下功能是在第一次移动后, 检查元素实际位置和期望位置是否相同, 不同则说明坐标系不是期望的. 则把初始位置减去偏移, 无论任何父元素导致了层叠上下文问题, 都能正确显示. |
| 3217 | + /* |
| 3218 | + check if the changed position is expected and correct it. about stacking context. |
| 3219 | + 当某父元素使用了transform属性时, fixed不再以窗口左上角为坐标. 以下功能是在第一次移动后, 检查元素实际位置和期望位置是否相同, 不同则说明坐标系不是期望的. 则把初始位置减去偏移, 无论任何父元素导致了层叠上下文问题, 都能正确显示. |
3220 | 3220 | */ |
3221 | 3221 |
|
3222 | 3222 | var nowPosition = getViewportPosition(movedElement); |
|
0 commit comments