habitica/app/assets/javascripts/habits.js.coffee

20 lines
624 B
CoffeeScript
Raw Normal View History

2012-02-01 04:09:00 +00:00
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
2012-02-01 21:55:33 +00:00
$(document).ready ->
2012-02-04 20:19:05 +00:00
2012-02-06 18:38:37 +00:00
$.each ['#habits', '#daily', '#one-offs'], (index, list_id) ->
2012-02-01 23:20:12 +00:00
$(list_id).sortable
axis: "y"
dropOnEmpty: false
cursor: "move"
items: "li"
opacity: 0.4
scroll: true
update: ->
$.ajax
type: "post"
url: "/habits/sort"
data: $(list_id).sortable("serialize")
2012-02-09 04:43:17 +00:00
dataType: "script"