Files
atom/src/stdlib/jquery-extensions.coffee

17 lines
360 B
CoffeeScript

$ = require 'jquery'
$.fn.scrollBottom = (newValue) ->
if newValue?
@scrollTop(newValue - @height())
else
@scrollTop() + @height()
$.fn.scrollRight = (newValue) ->
if newValue?
@scrollLeft(newValue - @width())
else
@scrollLeft() + @width()
$.fn.containsElement = (element) ->
(element[0].compareDocumentPosition(this[0]) & 8) == 8