mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Added jquery extension file
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
13
src/stdlib/jquery-extensions.coffee
Normal file
13
src/stdlib/jquery-extensions.coffee
Normal 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()
|
||||
Reference in New Issue
Block a user