Skip to content

Commit

Permalink
changed on to bind/delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
Takazudo committed Mar 28, 2013
1 parent d3da6cf commit da83671
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog.md
@@ -1,5 +1,9 @@
# jQuery.tinyscroller - changelog

## v.0.5.1

* changed to use bind/delegate instead of on for event bindings. This is for old jQuery compatibility.

## v.0.5.0

* implemented adjustEndY options
Expand Down
4 changes: 2 additions & 2 deletions jquery.tinyscroller.coffee
Expand Up @@ -318,7 +318,7 @@ do ($ = jQuery, window = window, document = document) ->
live: (selector) ->
selector = selector or @options.selector
self = @
$doc.on 'click', selector, (e) ->
$doc.delegate selector, 'click', (e) ->
e.preventDefault()
self.scrollTo (ns.getWhereTo @)
@
Expand All @@ -333,7 +333,7 @@ do ($ = jQuery, window = window, document = document) ->
$el = $(@)
$el.data 'tinyscroller', scroller
if $el.data 'tinyscrollerattached' then return @
$el.on 'click', (e) ->
$el.bind 'click', (e) ->
e.preventDefault()
scroller.scrollTo (ns.getWhereTo @)
$el.data 'tinyscrollerattached', true
Expand Down
4 changes: 2 additions & 2 deletions jquery.tinyscroller.js
Expand Up @@ -343,7 +343,7 @@
var self;
selector = selector || this.options.selector;
self = this;
$doc.on('click', selector, function(e) {
$doc.delegate(selector, 'click', function(e) {
e.preventDefault();
return self.scrollTo(ns.getWhereTo(this));
});
Expand All @@ -363,7 +363,7 @@
if ($el.data('tinyscrollerattached')) {
return this;
}
$el.on('click', function(e) {
$el.bind('click', function(e) {
e.preventDefault();
return scroller.scrollTo(ns.getWhereTo(this));
});
Expand Down
2 changes: 1 addition & 1 deletion jquery.tinyscroller.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit da83671

Please sign in to comment.