-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.fx.coffee
27 lines (23 loc) · 1.01 KB
/
jquery.fx.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
init = (Bacon, $) ->
fromPromise = Bacon.fromPromise
$.fn.extend
animateE: (args...) -> fromPromise @animate(args...).promise()
showE: (args...) -> fromPromise @show(args...).promise()
hideE: (args...)-> fromPromise @hide(args...).promise()
toggleE: (args...) -> fromPromise @toggle(args...).promise()
fadeInE: (args...) -> fromPromise @fadeIn(args...).promise()
fadeOutE: (args...) -> fromPromise @fadeOut(args...).promise()
fadeToE: (args...) -> fromPromise @fadeTo(args...).promise()
fadeToggleE: (args...) -> fromPromise @fadeToggle(args...).promise()
slideDownE: (args...) -> fromPromise @slideDown(args...).promise()
slideUpE: (args...) -> fromPromise @slideUp(args...).promise()
slideToggleE: (args...) -> fromPromise @slideToggle(args...).promise()
if module?
Bacon = require("baconjs")
$ = require("jquery")
module.exports = init(Bacon, $)
else
if typeof define == "function" and define.amd
define ["bacon", "jquery"], init
else
init(this.Bacon, this.$)