| | |
| | | var initOpen = function (ownerInstance) { |
| | | getState(ownerInstance); |
| | | if (state.opened.constructor === 'Boolean') { |
| | | // opened为boolen类型,判断默认打开 |
| | | // opened为boolean类型,判断默认打开 |
| | | if (state.opened && state.rightWidth > 0) { |
| | | swipeMove(-state.rightWidth); |
| | | } else if (state.opened && state.leftWidth > 0) { |
| | |
| | | if (state.direction !== 'horizontal') { |
| | | return; |
| | | } |
| | | if (!state.dragging) { |
| | | ownerInstance.triggerEvent('dragstart'); |
| | | } |
| | | state.dragging = true; |
| | | swipeMove(state.startOffset + state.deltaX); |
| | | return false; |
| | | }; |
| | | |
| | | var open = function (position) { |
| | |
| | | close(); |
| | | } |
| | | } |
| | | ownerInstance.triggerEvent('dragend'); |
| | | }; |
| | | |
| | | module.exports = { |