Sha256: ab69d03bd3554f4eb4c0a25c6aaf0af89c4203921610dd022c9e9dc2f08d8aff
Contents?: true
Size: 571 Bytes
Versions: 11
Compression:
Stored size: 571 Bytes
Contents
class Apiv1.IndexController extends Ember.ObjectController queryParams: ['anchor'] anchor: null +observer anchor scroll2Anchor: -> return @smoothScrollTo 0 unless _.contains ["about", "products", "contacts"], @anchor Ember.run.schedule 'afterRender', @, => el$ = $('#' + @anchor) @smoothScrollTo @topOffset el$ if el$.length > 0 smoothScrollTo: (y) -> $("#page-wrapper").animate scrollTop: y if y? topOffset: (el$) -> p1 = $(".site-content").position() p2 = el$.position() return unless p1? and p2? p2.top - p1.top
Version data entries
11 entries across 11 versions & 1 rubygems