Diff Revisions 76 vs 77 for /overscroll/jquery.overscroll.js
| 76 | 77 | <- Revisions | |
|
Diff lines for: Rev 76 : Lines 69 -> 84 Rev 77 : Lines 69 -> 93 |
|||
| 69 | 69 | closed: "http://static.azoffdesign.com/misc/closed.cur" | |
| 70 | 70 | }, | |
| 71 | 71 | ||
| 72 | + | // events handled by overscroll | |
| 73 | + | events: { | |
| 74 | + | wheel: "mousewheel DOMMouseScroll", | |
| 75 | + | start: "select mousedown touchstart", | |
| 76 | + | drag: "mousemove touchmove", | |
| 77 | + | end: "mouseup mouseleave touchend", | |
| 78 | + | ignored: "dragstart drag" | |
| 79 | + | }, | |
| 80 | + | ||
| 72 | 81 | // main initialization function | |
| 73 | 82 | init: function(data, target, size) { | |
| 74 | 83 | data = {}; | |
| 75 | 84 | ||
| 76 | 85 | target = $(this) | |
| 77 | 86 | .css({"cursor":"url("+o.icons.open+"), default", "overflow": "hidden"}) | |
| 78 | - | .bind("mousewheel DOMMouseScroll", data, o.wheel) | |
| 79 | - | .bind("select mousedown touchstart", data, o.start) | |
| 80 | - | .bind("mouseup mouseleave touchend", data, o.stop) | |
| 81 | - | .bind("ondragstart drag", function(){return false;}); // disable proprietary drag handlers | |
| 87 | + | .bind(o.events.wheel, data, o.wheel) | |
| 88 | + | .bind(o.events.start, data, o.start) | |
| 89 | + | .bind(o.events.end, data, o.stop) | |
| 90 | + | .bind(o.events.ignored, function(){return false;}); // disable proprietary drag handlers | |
| 82 | 91 | ||
| 83 | 92 | data.target = target; | |
| 84 | 93 | }, | |
|
Diff lines for: Rev 76 : Lines 106 -> 112 Rev 77 : Lines 115 -> 112 |
|||
| 106 | 115 | ||
| 107 | 116 | event.data.target | |
| 108 | 117 | .css("cursor", "url("+o.icons.closed+"), default") | |
| 109 | - | .bind("mousemove touchmove", event.data, o.drag) | |
| 118 | + | .bind(o.events.drag, event.data, o.drag) | |
| 110 | 119 | .stop(true, true); | |
| 111 | 120 | ||
| 112 | 121 | event.data.position = { | |
|
Diff lines for: Rev 76 : Lines 147 -> 153 Rev 77 : Lines 156 -> 153 |
|||
| 147 | 156 | ||
| 148 | 157 | event.data.target | |
| 149 | 158 | .css("cursor", "url("+o.icons.open+"), default") | |
| 150 | - | .unbind("mousemove touchmove", o.drag); | |
| 159 | + | .unbind(o.events.drag, o.drag); | |
| 151 | 160 | ||
| 152 | 161 | if ( event.data.isDragging ) { | |
| 153 | 162 | ||
View this file contents
View the full history
Commits for ad.dev:/overscroll/jquery.overscroll.js