(instance, events)
| 35 | |
| 36 | //bind the events |
| 37 | bindEvents(instance, events) { |
| 38 | let _loop = (eventName) => { |
| 39 | // ignore the event config which not satisfy |
| 40 | if (typeof eventName === 'string' && typeof events[eventName] === 'function') { |
| 41 | // binding event |
| 42 | instance.off(eventName) |
| 43 | instance.on(eventName, (param) => { |
| 44 | events[eventName](param, instance) |
| 45 | }) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | for (let eventName in events) { |
| 50 | _loop(eventName) |
| 51 | } |
| 52 | |
| 53 | } |
| 54 | |
| 55 | // render the dom |
| 56 | renderGLDom(cb) { |