Use Ember.run.throttle instead of $.throttle

This commit is contained in:
Piotr Sarnacki 2015-02-02 10:31:15 +01:00
parent cd1d4a80ce
commit c8211520f2
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ class Tailing
constructor: (@window, @tail_selector, @log_selector) -> constructor: (@window, @tail_selector, @log_selector) ->
@position = @window.scrollTop() @position = @window.scrollTop()
@window.scroll( $.throttle( 200, @onScroll.bind(this) ) ) @window.scroll( Ember.run.throttle(this, @onScroll, [], 200, false) )
this this
run: -> run: ->

View File

@ -6,7 +6,7 @@ class ToTop
# the calculations. # the calculations.
constructor: (@window, @element_selector, @container_selector) -> constructor: (@window, @element_selector, @container_selector) ->
@position = @window.scrollTop() @position = @window.scrollTop()
@window.scroll( $.throttle( 200, @onScroll.bind(this) ) ) @window.scroll( Ember.run.throttle(this, @onScroll, [], 200, false) )
this this
element: -> element: ->