Added jquery extension file

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-03-02 15:41:37 -08:00
parent 98defa865c
commit 78161f3341
2 changed files with 15 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ $ = require 'jquery'
GlobalKeymap = require 'global-keymap'
RootView = require 'root-view'
require 'jquery-extensions'
# This a weirdo file. We don't create a Window class, we just add stuff to
# the DOM window.

View File

@@ -0,0 +1,13 @@
$ = require 'jquery'
$.fn.scrollBottom = (newValue) ->
if newValue?
@scrollTop(newValue - @height())
else
@scrollTop() + @height()
$.fn.scrollRight = (newValue) ->
if newValue?
@scrollLeft(newValue - @width())
else
@scrollLeft() + @width()