mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
Refactored coffee script
This commit is contained in:
parent
ae9e9b0757
commit
f131c2bc40
1 changed files with 17 additions and 35 deletions
|
|
@ -3,40 +3,22 @@
|
|||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
|
||||
$(document).ready ->
|
||||
$("#habits").sortable
|
||||
axis: "y"
|
||||
dropOnEmpty: false
|
||||
cursor: "move"
|
||||
items: "li"
|
||||
opacity: 0.4
|
||||
scroll: true
|
||||
update: ->
|
||||
$.ajax
|
||||
type: "post"
|
||||
data: $("#habits").sortable("serialize")
|
||||
dataType: "script"
|
||||
complete: (request) ->
|
||||
$("#habits").effect "highlight"
|
||||
|
||||
url: "/habits/sort"
|
||||
|
||||
$(document).ready ->
|
||||
$("#daily").sortable
|
||||
axis: "y"
|
||||
dropOnEmpty: false
|
||||
cursor: "move"
|
||||
items: "li"
|
||||
opacity: 0.4
|
||||
scroll: true
|
||||
update: ->
|
||||
$.ajax
|
||||
type: "post"
|
||||
data: $("#daily").sortable("serialize")
|
||||
dataType: "script"
|
||||
complete: (request) ->
|
||||
$("#daily").effect "highlight"
|
||||
|
||||
url: "/habits/sort"
|
||||
$.each ['#habits', '#daily'], (index, list_id) ->
|
||||
$(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")
|
||||
dataType: "script"
|
||||
complete: (request) ->
|
||||
$(list_id).effect "highlight"
|
||||
|
||||
(($) ->
|
||||
$.fn.highlight = ->
|
||||
|
|
@ -45,4 +27,4 @@ $(document).ready ->
|
|||
background: "yellow"
|
||||
|
||||
$(this).fadeIn()
|
||||
) jQuery
|
||||
) jQuery
|
||||
|
|
|
|||
Loading…
Reference in a new issue