From e7b103728695bce3282068836a51d0943faac0b6 Mon Sep 17 00:00:00 2001 From: Pedro Rio Date: Fri, 18 Dec 2015 10:13:08 +0000 Subject: [PATCH] Allow calling `scrollVertical` with only the target All the options are optional, but if an empty object is not passed the `scrollVertical` method blows up with cannot reat offset of undefined. Now we can scrollVertical('#id') instead of having scrollVertical('#id',{}); --- addon/services/scroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/services/scroller.js b/addon/services/scroller.js index bb39246..500add0 100644 --- a/addon/services/scroller.js +++ b/addon/services/scroller.js @@ -35,7 +35,7 @@ export default Em.Service.extend({ return jQueryElement.offset().top + offset; }, - scrollVertical (target, opts) { + scrollVertical (target, opts = {}) { this.get('scrollable').animate({ scrollTop: this.getVerticalCoord(target, opts.offset) },